:root {
  --sky-1: #DFF2FF;
  --cream: #FFFDF6;
  --mint: #E6F8EE;
  --ink: #1C3144;
  --muted: #51687D;
  --sunny: #FFC947;
  --amber: #FF9F43;
  --coral: #FF7E67;
  --blue: #52B2F9;
  --sans: 'Quicksand', 'Be Vietnam Pro', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--sans);
  background: linear-gradient(180deg, var(--sky-1) 0%, #FFF9E8 52%, var(--mint) 100%);
  color: var(--ink); line-height: 1.6; overflow-x: hidden;
}
body.gate-locked { overflow: hidden; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }
.container { max-width: 1020px; margin: 0 auto; padding: 0 18px; }

.party-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1200; }

/* Gate */
.party-gate {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px; text-align: center;
  background: radial-gradient(circle at 50% 35%, #FFFDF6 0%, #DFF2FF 60%, #FFEBB7 100%);
  transition: opacity 0.75s ease, visibility 0.75s;
}
.party-gate.is-open { opacity: 0; visibility: hidden; pointer-events: none; }

.gate-balloons { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.g-balloon { position: absolute; font-size: 2rem; animation: floatBalloon 4.2s ease-in-out infinite; }
.g-balloon.b1 { left: 10%; top: 18%; }
.g-balloon.b2 { right: 12%; top: 22%; animation-delay: 0.7s; }
.g-balloon.b3 { left: 14%; bottom: 20%; animation-delay: 1.3s; }
.g-balloon.b4 { right: 14%; bottom: 18%; animation-delay: 0.4s; }
@keyframes floatBalloon { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-14px) rotate(4deg); } }

.gate-pill {
  position: relative; padding: 5px 16px; border-radius: 999px;
  background: #fff; border: 2px solid var(--blue); color: #1967A8;
  font-size: 0.78rem; font-weight: 800; margin-bottom: 8px;
}
.gate-guest { position: relative; margin: 0 0 16px; font-size: 1.05rem; font-weight: 700; color: #1967A8; }

.gift-gate-btn {
  position: relative; border: none; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  transition: transform 0.22s ease;
}
.gift-gate-btn:hover { transform: scale(1.05); }
.gift-box {
  position: relative; width: 144px; height: 132px;
  animation: bounceGift 2.1s ease-in-out infinite;
  will-change: transform;
}
@keyframes bounceGift { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.gift-lid {
  position: absolute; left: -6px; right: -6px; top: 0; height: 36px; z-index: 2;
  border-radius: 12px; background: linear-gradient(135deg, var(--sunny), var(--amber));
  border: 2.5px solid var(--ink); box-shadow: 0 4px 0 rgba(28, 49, 68, 0.14);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease;
}
.gift-bow { position: absolute; left: 50%; top: -24px; transform: translateX(-50%); font-size: 2rem; }
.gift-body {
  position: absolute; left: 0; right: 0; bottom: 0; top: 32px;
  border-radius: 0 0 18px 18px; background: #FFFDF6; border: 2.5px solid var(--ink);
  display: grid; place-items: center; box-shadow: 0 10px 0 rgba(28, 49, 68, 0.12);
}
.gift-ribbon-v { position: absolute; top: 0; bottom: 0; width: 22px; background: var(--coral); border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); }
.gift-peek { position: relative; z-index: 1; font-size: 2.8rem; transition: transform 0.45s ease; }

.party-gate.is-opening .gift-box { animation: none; }
.party-gate.is-opening .gift-lid { transform: translate3d(-16px, -48px, 0) rotate(-18deg); opacity: 0; }
.party-gate.is-opening .gift-peek { transform: translateY(-18px) scale(1.25); }

.gift-cta {
  padding: 12px 24px; border-radius: 999px;
  background: linear-gradient(135deg, var(--sunny), var(--amber));
  border: 2.5px solid var(--ink); box-shadow: 0 5px 0 var(--ink);
  font-weight: 800; font-size: 0.92rem; color: var(--ink);
}
.gate-name { position: relative; margin: 18px 0 4px; font-size: clamp(2rem, 6vw, 2.8rem); font-weight: 800; }
.gate-date { position: relative; margin: 0 0 8px; font-weight: 700; color: var(--muted); letter-spacing: 0.14em; }
.gate-tip { position: relative; margin: 0; font-size: 0.8rem; color: var(--muted); }

/* Music */
.music-pill {
  position: fixed; right: 16px; bottom: 16px; z-index: 900;
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border-radius: 999px;
  border: 2.2px solid var(--ink); background: #fff; color: var(--ink); cursor: pointer;
  box-shadow: 0 6px 0 rgba(28, 49, 68, 0.14);
}
.mp-disc { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #FFF2C6; border: 1.8px solid var(--ink); }
.music-pill.is-playing .mp-disc { animation: spin 4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.mp-meta { display: flex; flex-direction: column; text-align: left; line-height: 1.15; }
.mp-meta small { font-size: 0.66rem; font-weight: 800; color: #1967A8; }
.mp-meta strong { font-size: 0.76rem; max-width: 118px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Main */
.party-main { position: relative; z-index: 2; transition: opacity 0.75s ease, transform 0.75s ease; }
body.gate-locked .party-main { opacity: 0; visibility: hidden; transform: translateY(16px); pointer-events: none; }

.party-hero { padding: 36px 0 22px; }
.party-section { padding: 22px 0; }
.party-card {
  background: var(--cream); border: 2.5px solid var(--ink); border-radius: 26px; padding: 26px 22px;
  box-shadow: 0 9px 0 rgba(28, 49, 68, 0.08);
}
.hero-top-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.party-tag {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  background: #E8F6FF; border: 1.8px solid var(--ink); font-size: 0.74rem; font-weight: 800;
}
.guest-chip { margin: 0; padding: 4px 14px; border-radius: 999px; background: #FFF2C6; border: 1.5px solid var(--ink); font-weight: 800; font-size: 0.88rem; }

.hero-grid { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: center; text-align: center; }
.hero-pic-col { display: flex; justify-content: center; }
.baby-pic-btn {
  position: relative; width: 248px; padding: 8px; border-radius: 26px;
  border: 3px solid var(--ink); background: #fff; cursor: pointer;
  box-shadow: 0 10px 0 rgba(28, 49, 68, 0.12); transition: transform 0.2s ease;
}
.baby-pic-btn:hover { transform: translateY(-4px) rotate(-1deg); }
.baby-pic-btn.is-bouncing { animation: bouncePic 0.55s ease; }
@keyframes bouncePic { 50% { transform: translateY(-12px) scale(1.04); } }
.baby-pic-btn img { width: 100%; border-radius: 18px; }
.pic-badge { display: inline-block; margin-top: 8px; padding: 4px 12px; border-radius: 999px; background: var(--sunny); border: 1.5px solid var(--ink); font-size: 0.76rem; font-weight: 800; }

.party-title { margin: 0; font-size: clamp(2.1rem, 5.5vw, 3rem); font-weight: 800; line-height: 1.1; }
.date-pill { display: inline-flex; flex-direction: column; margin: 12px 0; padding: 8px 18px; border-radius: 14px; background: #E8F6FF; border: 2px solid var(--ink); }
.date-pill span { font-size: 0.84rem; font-weight: 700; color: #1967A8; }
.party-lead { margin: 0 0 14px; color: var(--muted); font-weight: 600; }
.baby-quote { padding: 12px 16px; border-radius: 16px; background: #FFF9E6; border: 2px dashed var(--amber); font-weight: 700; font-size: 0.9rem; margin-bottom: 14px; }

.stickers-box { padding: 14px; border-radius: 18px; background: #F1F9FF; border: 2px solid #BFE0FB; margin-bottom: 16px; }
.stickers-label { margin: 0 0 10px; font-size: 0.84rem; font-weight: 800; color: #1967A8; }
.stickers-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.sticker-btn {
  padding: 8px 4px; border-radius: 14px; border: 1.8px solid var(--ink); background: #fff; color: var(--ink);
  cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: transform 0.16s ease, background 0.16s ease;
}
.sticker-btn span { font-size: 1.45rem; }
.sticker-btn small { font-size: 0.72rem; font-weight: 800; }
.sticker-btn:hover, .sticker-btn.is-active { background: #FFE699; transform: translateY(-3px); }
.sticker-msg { font-size: 0.84rem; font-weight: 700; color: var(--ink); padding: 8px 10px; border-radius: 10px; background: #fff; border: 1.5px dashed #BFE0FB; }

.party-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.center-row { justify-content: center; }
.btn-sunny, .btn-sky {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 20px; border-radius: 999px;
  border: 2.2px solid var(--ink); font-size: 0.88rem; font-weight: 800; text-decoration: none; cursor: pointer;
  box-shadow: 0 5px 0 var(--ink); transition: transform 0.14s ease;
}
.btn-sunny { background: linear-gradient(135deg, var(--sunny), #FFB347); color: var(--ink); }
.btn-sky { background: #fff; color: var(--ink); }
.btn-sunny:hover, .btn-sky:hover { transform: translateY(-2px); }

.grid-2 { display: grid; grid-template-columns: 1fr; gap: 20px; }
.party-card h2 { margin: 8px 0; font-size: 1.55rem; font-weight: 800; }
.muted { color: var(--muted); font-weight: 600; font-size: 0.92rem; margin: 0 0 14px; }
.center { text-align: center; }

.zz-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.zz-btn { padding: 10px 6px; border-radius: 14px; border: 2px solid var(--ink); background: #F5FAFF; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform 0.16s ease, background 0.16s ease; }
.zz-btn span { font-size: 1.55rem; }
.zz-btn strong { font-size: 0.8rem; }
.zz-btn:hover, .zz-btn.is-picked { background: #FFE699; transform: translateY(-3px); }
.zz-result { padding: 12px; border-radius: 14px; background: #FFF9E6; border: 2px solid var(--sunny); font-size: 0.88rem; font-weight: 700; }

.time-hl { margin: 0 0 14px; font-weight: 800; color: #1967A8; }
.cd-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.cd-grid div { padding: 12px 4px; border-radius: 14px; background: #E8F6FF; border: 2px solid var(--ink); }
.cd-grid strong { display: block; font-size: 1.85rem; line-height: 1; }
.cd-grid span { font-size: 0.72rem; font-weight: 700; color: var(--muted); }
.note-sm { margin: 10px 0 0; font-size: 0.76rem; color: var(--muted); }
.expired-p { color: #D94E4E; font-weight: 800; }

.story-card { text-align: center; margin-bottom: 18px; }
.gal-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.gal-item { background: #fff; border: 2.2px solid var(--ink); border-radius: 20px; padding: 18px; box-shadow: 0 6px 0 rgba(28, 49, 68, 0.08); }
.gal-item h3 { margin: 8px 0 4px; font-size: 1.06rem; }
.gal-item p { margin: 0; font-size: 0.88rem; color: var(--muted); font-weight: 600; }
.gal-thumb { aspect-ratio: 4/3; border-radius: 14px; overflow: hidden; border: 2px solid var(--ink); margin-bottom: 10px; background: linear-gradient(135deg, #DFF2FF, #FFF2C6); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gal-thumb img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }

.party-map { margin-top: 14px; border-radius: 16px; overflow: hidden; border: 2.2px solid var(--ink); height: 250px; }
.party-map iframe { width: 100%; height: 100%; border: 0; }
.qr-box { display: inline-block; padding: 10px; border-radius: 18px; background: #fff; border: 2.5px solid var(--ink); cursor: zoom-in; margin: 8px 0 12px; }
.qr-box img { width: 215px; border-radius: 10px; }
.bank-info { display: flex; flex-direction: column; gap: 3px; font-size: 0.92rem; font-weight: 700; margin-bottom: 14px; }
.stk { font-size: 1.3rem; color: #1967A8; letter-spacing: 0.06em; }

.party-form input, .party-form select, .party-form textarea { width: 100%; padding: 11px 14px; margin-bottom: 12px; border-radius: 14px; border: 2px solid var(--ink); background: #FAFDFB; color: var(--ink); font-size: 0.94rem; font-weight: 600; }
.form-split { display: grid; grid-template-columns: 1fr 100px; gap: 10px; }
.wishes-list { display: flex; flex-direction: column; gap: 10px; max-height: 360px; overflow-y: auto; }
.wish-item { padding: 12px 14px; border-radius: 14px; background: #E8F6FF; border: 1.8px solid var(--ink); }
.wish-item strong { display: block; font-size: 0.92rem; }
.wish-item p { margin: 3px 0 0; font-size: 0.88rem; color: var(--muted); font-weight: 600; }

.party-footer { text-align: center; padding: 30px 18px 80px; font-weight: 700; color: var(--muted); }
.lightbox { position: fixed; inset: 0; z-index: 1500; background: rgba(20, 35, 50, 0.9); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; color: #fff; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 76vh; border-radius: 16px; border: 3px solid #fff; }
.lb-close { position: absolute; top: 16px; right: 18px; width: 42px; height: 42px; border-radius: 50%; border: 2px solid #fff; background: transparent; color: #fff; font-size: 1.4rem; cursor: pointer; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 1600; padding: 10px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 0.86rem; font-weight: 800; }
.toast[hidden] { display: none; }

@media (min-width: 780px) {
  .hero-grid { grid-template-columns: 268px 1fr; text-align: left; }
  .party-actions { justify-content: flex-start; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .gal-grid { grid-template-columns: repeat(4, 1fr); }
  .zz-grid { grid-template-columns: repeat(5, 1fr); }
}
