:root {
  --theme: #6a060d;
  --theme-soft: #7b0b0c;
  --paper: #fffaf8;
  --text: #2a2a2a;
  --max: 500px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: #1a0507;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
  height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(106, 6, 13, 0.35), transparent 60%),
    #140305;
}

.canvas-wrap {
  width: min(100vw, var(--max));
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.45);
  background: #fff;
}

.canvas {
  position: relative;
  transform-origin: top left;
  overflow: hidden;
}

.el {
  position: absolute;
  --base-transform: translate3d(0,0,0);
  --anim-duration: 1.3s;
  --anim-delay: 0.3s;
  --anim-ease: ease-out;
  --loop-duration: 2s;
  --loop-delay: 0s;
}

.text div {
  display: block;
}

.photo img,
.material img {
  pointer-events: none;
  user-select: none;
}

/* ===== Entrance animations (from Cinelove template) ===== */
.reveal {
  --el-opacity: 1;
  opacity: 0 !important;
  filter: blur(6px);
  will-change: transform, opacity, filter;
  transition:
    opacity var(--anim-duration) var(--anim-ease) var(--anim-delay),
    transform var(--anim-duration) cubic-bezier(0.16, 1, 0.3, 1) var(--anim-delay),
    filter calc(var(--anim-duration) * 0.9) ease var(--anim-delay);
}

.reveal.reveal--slide-up {
  transform: translate3d(0, 56px, 0) scale(0.96) var(--base-transform);
}

.reveal.reveal--slide-down {
  transform: translate3d(0, -56px, 0) scale(0.96) var(--base-transform);
}

.reveal.reveal--slide-left {
  transform: translate3d(64px, 0, 0) scale(0.96) var(--base-transform);
}

.reveal.reveal--slide-right {
  transform: translate3d(-64px, 0, 0) scale(0.96) var(--base-transform);
}

.reveal.reveal--fade-in,
.reveal.reveal--fade {
  transform: scale(0.97) var(--base-transform);
}

.reveal.reveal--zoom-in {
  transform: scale(0.84) var(--base-transform);
}

.reveal.is-inview {
  opacity: var(--el-opacity) !important;
  transform: var(--base-transform);
  filter: blur(0);
}

/* After entrance finishes, continuous loops can take over cleanly */
.reveal.is-inview.loop--wiggle {
  animation: wiggle var(--loop-duration) ease-in-out var(--loop-delay) infinite;
}

.reveal.is-inview.loop--pulse {
  animation: pulse-scale var(--loop-duration) ease-in-out var(--loop-delay) infinite;
}

.loop--wiggle:not(.reveal) {
  animation: wiggle var(--loop-duration) ease-in-out var(--loop-delay) infinite;
}

.loop--pulse:not(.reveal) {
  animation: pulse-scale var(--loop-duration) ease-in-out var(--loop-delay) infinite;
}

@keyframes wiggle {
  0%, 100% { transform: var(--base-transform) rotate(0deg); }
  20% { transform: var(--base-transform) rotate(-6deg); }
  40% { transform: var(--base-transform) rotate(5deg); }
  60% { transform: var(--base-transform) rotate(-4deg); }
  80% { transform: var(--base-transform) rotate(3deg); }
}

@keyframes pulse-scale {
  0%, 100% { transform: var(--base-transform) scale(1); }
  50% { transform: var(--base-transform) scale(1.08); }
}

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: var(--el-opacity, 1) !important;
    transform: var(--base-transform) !important;
    transition: none !important;
  }
  .loop--wiggle,
  .loop--pulse,
  .reveal.is-inview.loop--wiggle,
  .reveal.is-inview.loop--pulse,
  .music-btn.is-playing img,
  .open-heart {
    animation: none !important;
  }
}

.map {
  border: 2px solid var(--theme);
  background: linear-gradient(180deg, #fff7f5 0%, #f3e4e0 100%) !important;
}

.map-card {
  text-align: center;
  padding: 18px 16px;
  width: 100%;
}

.map-pin {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto 10px;
  display: block;
  box-shadow: 0 6px 16px rgba(106, 6, 13, 0.25);
}

.map-title {
  font-family: 'Marmelad', sans-serif;
  font-size: 18px;
  color: var(--theme);
  margin-bottom: 6px;
}

.map-desc {
  font-size: 13px;
  line-height: 1.45;
  color: #555;
  margin-bottom: 12px;
  padding: 0 12px;
}

.map-cta {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--theme);
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.rsvp-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  font-size: 14px;
  color: #333;
}

.rsvp-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-family: 'Marmelad', sans-serif;
  color: var(--theme);
  text-align: center;
}

.rsvp-form label,
.rsvp-form fieldset {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 0;
  margin: 0;
  padding: 0;
  font-size: 13px;
}

.rsvp-form legend {
  margin-bottom: 6px;
  padding: 0;
}

.rsvp-form input[type='text'],
.rsvp-form input:not([type]),
.rsvp-form input[name='name'],
.rsvp-form select {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}

.rsvp-form .radio {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.rsvp-form button {
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.rsvp-form button:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.rsvp-msg {
  margin: 0;
  text-align: center;
  color: var(--theme);
  font-size: 13px;
}

.countdown {
  gap: 18px;
  color: #fff;
}

.cd-item {
  min-width: 56px;
  text-align: center;
}

.cd-num {
  display: block;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.cd-label {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  opacity: 0.92;
}

.music-btn {
  position: fixed;
  right: 14px;
  bottom: 18px;
  z-index: 10001;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.music-btn img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  filter: none;
}

.music-btn.is-playing img {
  animation: spin 4s linear infinite;
}

.music-btn.is-muted {
  opacity: 0.75;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.curtain {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  pointer-events: auto;
}

.curtain-panel {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 180, 190, 0.18), transparent 40%),
    radial-gradient(circle at 70% 80%, rgba(255, 120, 140, 0.12), transparent 45%),
    linear-gradient(180deg, #9a1720 0%, #6a060d 45%, #2a0205 100%);
  transition: transform 1.35s cubic-bezier(0.77, 0, 0.18, 1);
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.28);
}
.curtain-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(120deg, transparent 40%, rgba(255,255,255,0.08) 48%, transparent 56%);
  background-size: 200% 100%;
  animation: curtainSheen 3.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes curtainSheen {
  0% { background-position: 120% 0; }
  100% { background-position: -40% 0; }
}

.curtain-panel.left {
  left: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.curtain-panel.right {
  right: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.curtain.is-open .curtain-panel.left {
  transform: translateX(-105%);
}

.curtain.is-open .curtain-panel.right {
  transform: translateX(105%);
}

.curtain.is-open {
  pointer-events: none;
}

.curtain.is-gone {
  display: none;
}

.open-btn {
  position: relative;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: linear-gradient(145deg, rgba(255,255,255,0.18), rgba(255,255,255,0.06));
  color: #fff;
  border-radius: 20px;
  padding: 20px 32px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(255,255,255,0.08) inset,
    0 0 40px rgba(255, 120, 140, 0.2);
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
  font-family: 'Marmelad', sans-serif;
  letter-spacing: 0.04em;
  animation: openBtnFloat 3s ease-in-out infinite;
}
@keyframes openBtnFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.open-btn:hover {
  animation-play-state: paused;
  transform: translateY(-4px) scale(1.02);
  background: linear-gradient(145deg, rgba(255,255,255,0.24), rgba(255,255,255,0.1));
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.32),
    0 0 50px rgba(255, 140, 160, 0.28);
}

.open-btn span {
  font-size: 18px;
}

.open-btn small {
  opacity: 0.85;
  font-family: 'Ephesis', cursive;
  font-size: 20px;
}

.open-heart {
  color: #ffd0d5;
  font-size: 22px !important;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  z-index: 10020;
  background: rgba(20, 3, 5, 0.92);
  color: #fff;
  padding: 12px 16px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

@media (min-width: 768px) {
  .canvas-wrap {
    margin: 24px 0;
    border-radius: 12px;
  }
}


/* ===== FEATURE LAYER ===== */

:root {
  --toolbar-h: 68px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --sheet-bg: #fffaf9;
  --sheet-radius: 22px;
}

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

.app-body {
  padding-bottom: calc(var(--toolbar-h) + var(--safe-bottom) + 8px);
}

.page {
  min-height: 100dvh;
  padding-top: var(--safe-top);
}

.canvas-wrap {
  width: min(100vw, var(--max));
  max-width: 100%;
}

/* Hide old floating music on small screens; toolbar handles it */
@media (max-width: 900px) {
  .music-btn {
    display: none;
  }
}

@media (min-width: 901px) {
  .page {
    padding: 28px 0 calc(var(--toolbar-h) + 40px);
  }
  .canvas-wrap {
    border-radius: 18px;
    outline: 1px solid rgba(255,255,255,0.08);
  }
}

/* ===== Mobile toolbar ===== */
.mobile-toolbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10030;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  gap: 2px;
  width: min(100vw, var(--max));
  max-width: var(--max);
  min-height: var(--toolbar-h);
  margin: 0 auto;
  padding: 8px 6px calc(8px + var(--safe-bottom));
  background: rgba(255, 250, 248, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(106, 6, 13, 0.08);
  box-shadow: 0 -8px 28px rgba(40, 0, 8, 0.12);
  box-sizing: border-box;
  overflow: visible;
}

.tb-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #5a2a30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 2px;
  cursor: pointer;
  font: inherit;
  min-height: 52px;
  border-radius: 14px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.tb-btn:active {
  transform: scale(0.96);
  background: rgba(106, 6, 13, 0.06);
}

.tb-ico {
  font-size: 20px;
  line-height: 1;
}

.tb-label {
  font-size: 10px;
  letter-spacing: 0.02em;
  opacity: 0.9;
}

.tb-main {
  transform: translateY(-10px);
}

.tb-main:active {
  transform: translateY(-10px) scale(0.96);
}

.tb-ico-main {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #9a1a24, #6a060d);
  box-shadow: 0 10px 20px rgba(106, 6, 13, 0.35);
  border: 3px solid #fff;
}

.tb-ico-main img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  animation: bounceGift 1.6s ease-in-out infinite;
}

@keyframes bounceGift {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.06); }
}

.tb-btn.is-active .tb-label {
  color: var(--theme);
  font-weight: 700;
}

/* ===== Sheets ===== */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10040;
  background: rgba(20, 3, 5, 0.45);
  backdrop-filter: blur(2px);
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10050;
  max-height: min(78dvh, 680px);
  overflow: auto;
  background: var(--sheet-bg);
  border-radius: var(--sheet-radius) var(--sheet-radius) 0 0;
  padding: 10px 16px calc(18px + var(--safe-bottom));
  box-shadow: 0 -12px 40px rgba(0,0,0,0.25);
  animation: sheetIn 0.28s ease-out;
}

.sheet-tall {
  max-height: min(86dvh, 760px);
}

@keyframes sheetIn {
  from { transform: translateY(24px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}

.sheet-handle {
  width: 42px;
  height: 4px;
  border-radius: 99px;
  background: #e2c9cc;
  margin: 4px auto 10px;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.sheet-head h2 {
  margin: 0;
  font-size: 18px;
  color: var(--theme);
  font-family: 'Marmelad', sans-serif;
}

.sheet-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #f1e4e5;
  color: #5a2a30;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.sheet-sub {
  margin: 0 0 12px;
  color: #7a555a;
  font-size: 13px;
}

.sheet-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 12px;
}

.sheet-form.col {
  grid-template-columns: 1fr;
}

.sheet-form input,
.sheet-form textarea,
.sheet-form select {
  width: 100%;
  border: 1px solid #ebd0d3;
  border-radius: 12px;
  padding: 12px 12px;
  font: inherit;
  background: #fff;
  color: #333;
}

.sheet-form textarea {
  resize: vertical;
  min-height: 96px;
}

.primary-btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #8d121c, #6a060d);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(106, 6, 13, 0.25);
}

.primary-btn:active {
  transform: scale(0.98);
}

/* Gift grid */
.gift-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.gift-item {
  appearance: none;
  border: 1px solid transparent;
  background: #fff;
  border-radius: 16px;
  padding: 10px 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(106, 6, 13, 0.06);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.gift-item:hover {
  transform: translateY(-2px);
}

.gift-item.is-selected {
  border-color: var(--theme);
  box-shadow: 0 8px 18px rgba(106, 6, 13, 0.16);
  background: #fff5f6;
}

.gift-item .g-emoji,
.gift-item img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  font-size: 34px;
  line-height: 42px;
  text-align: center;
}

.gift-item .g-name {
  font-size: 11px;
  color: #5a2a30;
  text-align: center;
  line-height: 1.2;
}

/* Wish list */
.wish-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wish-card {
  background: #fff;
  border-radius: 14px;
  padding: 12px 12px 10px;
  box-shadow: 0 4px 14px rgba(106, 6, 13, 0.06);
}

.wish-card strong {
  display: block;
  color: var(--theme);
  font-size: 13px;
  margin-bottom: 4px;
}

.wish-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #444;
}

.wish-card time {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: #999;
}

.wish-empty {
  text-align: center;
  color: #999;
  font-size: 13px;
  padding: 12px;
}

/* Menu */
.menu-list {
  display: grid;
  gap: 8px;
}

.menu-list button {
  appearance: none;
  border: 1px solid #f0dfe1;
  background: #fff;
  border-radius: 14px;
  padding: 14px 14px;
  text-align: left;
  font: inherit;
  color: #402428;
  cursor: pointer;
}

.menu-list button:active {
  background: #fff5f6;
}

/* Gift feed */
.gift-feed {
  position: fixed;
  left: max(10px, calc(50vw - min(100vw, var(--max)) / 2 + 10px));
  bottom: calc(var(--toolbar-h) + var(--safe-bottom) + 12px);
  z-index: 10020;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(220px, calc(min(100vw, var(--max)) - 24px));
  pointer-events: none;
}

.gift-feed-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.92);
  border-radius: 999px;
  padding: 6px 10px 6px 6px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  animation: feedIn 0.35s ease-out;
  font-size: 12px;
  color: #402428;
}

.gift-feed-item img,
.gift-feed-item .g-emoji {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: contain;
  font-size: 22px;
  line-height: 28px;
  text-align: center;
  background: #fff5f6;
}

@keyframes feedIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

/* FX layer: flying gifts / hearts */
.fx-layer {
  position: fixed;
  inset: 0;
  z-index: 10025;
  pointer-events: none;
  overflow: hidden;
}

.fx-float {
  position: absolute;
  left: 50%;
  bottom: 12%;
  font-size: 42px;
  will-change: transform, opacity;
  animation: floatGift 2.4s ease-out forwards;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,0.15));
}

.fx-float img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

@keyframes floatGift {
  0% { opacity: 0; transform: translate(-50%, 20px) scale(0.6) rotate(-8deg); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), -72vh) scale(1.15) rotate(12deg); }
}

.fx-burst {
  position: absolute;
  font-size: 18px;
  animation: burst 1.2s ease-out forwards;
}

@keyframes burst {
  0% { opacity: 1; transform: translate(0,0) scale(0.6); }
  100% { opacity: 0; transform: translate(var(--bx), var(--by)) scale(1.2); }
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10060;
  background: rgba(10, 2, 4, 0.94);
  display: none;
  place-items: center;
  padding: 48px 16px 24px;
}

.lightbox.is-open {
  display: grid;
}

/* Ensure hidden attribute always wins for overlays */
.lightbox[hidden],
.sheet[hidden],
.sheet-backdrop[hidden],
.toast[hidden] {
  display: none !important;
}

.lightbox img {
  max-width: min(100%, 720px);
  max-height: min(82dvh, 900px);
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.lightbox-close {
  position: absolute;
  top: calc(10px + var(--safe-top));
  right: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 28px;
  cursor: pointer;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 30px;
  cursor: pointer;
}

.lightbox-nav.prev { left: 10px; }
.lightbox-nav.next { right: 10px; }

/* Toast above toolbar */
.toast {
  bottom: calc(var(--toolbar-h) + var(--safe-bottom) + 18px);
}

/* Open button more mobile friendly */
.open-btn {
  min-width: 180px;
}

/* Album photos clickable cursor when lightbox enabled */
.photo.is-album {
  cursor: zoom-in;
}

/* Very small phones */
@media (max-width: 360px) {
  .gift-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .tb-label {
    font-size: 9px;
  }
}

/* Landscape phones: compact toolbar labels */
@media (max-height: 430px) and (orientation: landscape) {
  .mobile-toolbar {
    min-height: 56px;
  }
  .tb-main {
    transform: translateY(-4px);
  }
  .sheet {
    max-height: 92dvh;
  }
}

body.sheet-open {
  overflow: hidden;
}

body.sheet-open .mobile-toolbar {
  opacity: 0.35;
  pointer-events: none;
}


/* Toolbar button overflow guards */
.mobile-toolbar .tb-btn {
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

.mobile-toolbar .tb-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-toolbar .tb-main {
  overflow: visible;
}


/* ===== Desktop toolbar align ===== */
@media (min-width: 901px) {
  .mobile-toolbar {
    left: 0;
    right: 0;
    width: min(var(--max), calc(100vw - 32px));
    max-width: var(--max);
    margin: 0 auto;
    bottom: calc(16px + var(--safe-bottom));
    border-radius: 22px;
    border: 1px solid rgba(106, 6, 13, 0.1);
    box-shadow: 0 10px 30px rgba(40, 0, 8, 0.18);
  }

  .music-btn {
    /* sit near the invite column, not far right of ultrawide screens */
    right: max(16px, calc((100vw - min(100vw, var(--max))) / 2 - 58px));
    bottom: calc(22px + var(--safe-bottom));
  }

  .gift-feed {
    left: max(12px, calc((100vw - min(100vw, var(--max))) / 2 + 12px));
    bottom: calc(var(--toolbar-h) + var(--safe-bottom) + 20px);
  }
}

@media (max-width: 900px) {
  .mobile-toolbar {
    width: 100%;
    max-width: none;
    margin: 0;
    border-radius: 0;
    left: 0;
    right: 0;
  }
}


/* ===== BEAUTY FX LAYER ===== */

/* Ambient floating petals / hearts */
.ambient-layer,
.sparkle-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10010;
  overflow: hidden;
}

.sparkle-layer {
  z-index: 10012;
}

.ambient-item {
  position: absolute;
  top: -10vh;
  font-size: 16px;
  opacity: 0;
  animation: ambientFall linear forwards;
  filter: drop-shadow(0 4px 8px rgba(106, 6, 13, 0.15));
  will-change: transform, opacity;
}

@keyframes ambientFall {
  0% {
    opacity: 0;
    transform: translate3d(0, -10vh, 0) rotate(0deg) scale(0.7);
  }
  8% { opacity: 0.9; }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift, 40px), 110vh, 0) rotate(var(--rot, 180deg)) scale(1);
  }
}

.sparkle-dot {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #ffd0d8 40%, transparent 70%);
  animation: twinkle var(--dur, 2.4s) ease-in-out infinite;
  opacity: 0;
}

@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.4); }
  50% { opacity: 0.9; transform: scale(1.2); }
}

.curtain-sparkles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.curtain-sparkles span {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.35;
  animation: curtainDot 2.8s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(255,220,230,0.8);
}

@keyframes curtainDot {
  0%, 100% { opacity: 0.15; transform: scale(0.7); }
  50% { opacity: 0.85; transform: scale(1.4); }
}

/* Soft vignette after open */
body.invite-open .page::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 180, 190, 0.08), transparent 45%),
    radial-gradient(ellipse at 50% 100%, rgba(106, 6, 13, 0.12), transparent 50%);
}

/* Photo shine + hover */
.photo {
  overflow: hidden;
}

.photo.is-album img {
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
}

.photo.is-album:hover img {
  transform: scale(1.04);
  filter: brightness(1.04) saturate(1.05);
}

.photo.is-album::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,0.28) 48%, transparent 62%);
  transform: translateX(-130%);
  transition: none;
  pointer-events: none;
}

.photo.is-album.is-inview::after {
  animation: photoShine 2.4s ease 0.4s 1;
}

@keyframes photoShine {
  0% { transform: translateX(-130%); }
  100% { transform: translateX(130%); }
}

/* Fancy text accents */
.text.is-inview {
  text-shadow: 0 1px 0 rgba(255,255,255,0.02);
}

.el.text[style*="Ephesis"],
.el.text[style*="Great Vibes"],
.el.text[style*="Chillatos"] {
  letter-spacing: 0.01em;
}

/* Countdown pop */
.countdown.is-inview .cd-num {
  animation: cdPop 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.countdown.is-inview .cd-item:nth-child(1) .cd-num { animation-delay: 0.05s; }
.countdown.is-inview .cd-item:nth-child(2) .cd-num { animation-delay: 0.12s; }
.countdown.is-inview .cd-item:nth-child(3) .cd-num { animation-delay: 0.19s; }
.countdown.is-inview .cd-item:nth-child(4) .cd-num { animation-delay: 0.26s; }

@keyframes cdPop {
  from { transform: translateY(10px) scale(0.8); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* Map pulse border */
.map.is-inview {
  animation: mapGlow 2.8s ease-in-out infinite;
}

@keyframes mapGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(106, 6, 13, 0.0); }
  50% { box-shadow: 0 0 0 6px rgba(106, 6, 13, 0.08); }
}

/* Gift fly upgrades */
.fx-float {
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 10px 16px rgba(106, 6, 13, 0.25));
}

.fx-ring {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 140, 160, 0.8);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.4);
  animation: ringBurst 0.9s ease-out forwards;
  pointer-events: none;
}

@keyframes ringBurst {
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(8);
    border-color: rgba(255,140,160,0);
  }
}

.fx-confetti {
  position: absolute;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  animation: confetti 1.3s ease-out forwards;
  will-change: transform, opacity;
}

@keyframes confetti {
  0% { opacity: 1; transform: translate3d(0,0,0) rotate(0deg); }
  100% { opacity: 0; transform: translate3d(var(--cx), var(--cy), 0) rotate(var(--cr)); }
}

/* Toolbar main bounce a bit richer */
.tb-ico-main {
  animation: giftHalo 2.4s ease-in-out infinite;
}

@keyframes giftHalo {
  0%, 100% { box-shadow: 0 10px 20px rgba(106, 6, 13, 0.35), 0 0 0 0 rgba(255, 120, 140, 0.35); }
  50% { box-shadow: 0 12px 24px rgba(106, 6, 13, 0.4), 0 0 0 10px rgba(255, 120, 140, 0); }
}

/* Soft parallax helper class set by JS */
.canvas.is-parallax .el.photo.is-album.is-inview {
  transition: transform 0.2s linear;
}

@media (prefers-reduced-motion: reduce) {
  .ambient-item,
  .sparkle-dot,
  .curtain-sparkles span,
  .photo.is-album::after,
  .open-btn,
  .tb-ico-main,
  .map.is-inview,
  .fx-ring,
  .fx-confetti {
    animation: none !important;
  }
  .reveal {
    filter: none !important;
  }
}
