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

:root {
  --cream: #fdf6ec;
  --gold: #ffd54a;
  --rose: #ff4d8d;
}

html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: #000;
  color: var(--cream);
  font-family: 'Poppins', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

#stage { position: fixed; inset: 0; z-index: 1; display: block; background: #000; touch-action: none; }

/* ---------------- overlay text ---------------- */
.overlay-ui {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding-bottom: clamp(2rem, 9vh, 5rem);
  text-align: center;
}
.tagline {
  font-family: 'Playfair Display', serif; font-style: italic;
  font-size: clamp(1.05rem, 3.4vw, 1.6rem);
  color: rgba(253, 246, 236, 0.9);
  opacity: 0; transform: translateY(12px);
  transition: opacity 1.1s ease, transform 1.1s ease;
  text-shadow: 0 0 30px rgba(255, 213, 74, 0.5);
  max-width: 88vw;
}
.tagline.show { opacity: 1; transform: none; }
.hint {
  margin-top: 1.2rem;
  font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(253, 246, 236, 0.3);
  opacity: 0; transition: opacity 1.2s ease 0.4s;
}
.hint.show { opacity: 1; }

/* ---------------- sound toggle ---------------- */
.sound-btn {
  position: fixed; top: 1rem; left: 1rem; z-index: 60;
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.06); backdrop-filter: blur(10px);
  border: 1px solid rgba(253, 246, 236, 0.16);
  color: var(--cream); font-size: 1rem; cursor: pointer;
  display: grid; place-items: center;
  transition: background 0.2s, transform 0.2s;
}
.sound-btn:hover { background: rgba(255, 255, 255, 0.14); transform: translateY(-1px); }

/* ---------------- customise button ---------------- */
.edit-fab {
  position: fixed; top: 1rem; right: 1rem; z-index: 60;
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(10px);
  border: 1px solid rgba(253, 246, 236, 0.18); border-radius: 50px;
  color: var(--cream); font-family: 'Poppins', sans-serif; font-size: 0.82rem;
  padding: 0.55rem 1.1rem; cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  animation: editPulse 2.8s ease-in-out infinite;
}
.edit-fab[hidden] { display: none; }
.edit-fab:hover { background: rgba(255, 213, 74, 0.32); transform: translateY(-1px); }
.edit-fab__ico { color: var(--gold); }
@keyframes editPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 213, 74, 0); }
  50%      { box-shadow: 0 0 0 8px rgba(255, 213, 74, 0.10); }
}

/* ---------------- editor ---------------- */
.ed-screen {
  position: fixed; inset: 0; z-index: 100; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: radial-gradient(ellipse at 50% -10%, #1a1430 0%, #0c0a16 60%, #050409 100%);
}
.ed-screen[hidden] { display: none; }
.ed-wrap { max-width: 640px; margin: 0 auto; padding: clamp(2rem, 6vw, 4rem) clamp(1.1rem, 5vw, 2rem) 5rem; }
.ed-head { text-align: center; margin-bottom: 2.2rem; }
.ed-kicker { font-size: 0.7rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--gold); margin-bottom: 0.9rem; }
.ed-title { font-family: 'Playfair Display', serif; font-weight: 600; font-size: clamp(1.8rem, 6vw, 2.8rem); line-height: 1.06; color: var(--cream); }
.ed-sub { margin: 1rem auto 0; max-width: 32rem; font-size: 0.95rem; line-height: 1.7; font-weight: 300; color: rgba(253, 246, 236, 0.6); }

.ed-card {
  background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(253, 246, 236, 0.08);
  border-radius: 18px; padding: clamp(1.2rem, 4vw, 1.8rem); margin-bottom: 1.4rem;
}
.ed-field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1.1rem; }
.ed-field:last-child { margin-bottom: 0; }
.ed-field > span { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(253, 246, 236, 0.5); }
.ed-field input {
  width: 100%; background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(253, 246, 236, 0.12);
  border-radius: 10px; color: var(--cream); font-family: 'Poppins', sans-serif; font-size: 0.95rem;
  padding: 0.7rem 0.85rem; transition: border-color 0.2s, box-shadow 0.2s;
}
.ed-field input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 213, 74, 0.18); }
.ed-field input::placeholder { color: rgba(253, 246, 236, 0.3); }

.ed-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; margin-top: 1.6rem; }
.ed-btn { font-family: 'Poppins', sans-serif; font-size: 0.95rem; font-weight: 500; border-radius: 50px; padding: 0.85rem 1.8rem; cursor: pointer; border: none; transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s; }
.ed-btn--solid { background: linear-gradient(135deg, var(--gold) 0%, #ff9d3b 100%); color: #2a1c00; box-shadow: 0 8px 26px rgba(255, 213, 74, 0.32); }
.ed-btn--solid:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(255, 213, 74, 0.42); }
.ed-btn--ghost { background: transparent; color: var(--cream); border: 1px solid rgba(253, 246, 236, 0.2); }
.ed-btn--ghost:hover { background: rgba(255, 255, 255, 0.06); }
.ed-foot { margin-top: 2rem; text-align: center; font-size: 0.8rem; color: rgba(253, 246, 236, 0.35); }
.ed-foot a { color: var(--gold); text-decoration: none; }
.ed-foot a:hover { text-decoration: underline; }

/* ---------------- share modal ---------------- */
.ed-share { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 1.2rem; }
.ed-share[hidden] { display: none; }
.ed-share-backdrop { position: absolute; inset: 0; background: rgba(4, 3, 8, 0.74); backdrop-filter: blur(4px); }
.ed-share-box { position: relative; z-index: 1; width: 100%; max-width: 30rem; background: linear-gradient(180deg, #1a1430 0%, #100c1c 100%); border: 1px solid rgba(253, 246, 236, 0.1); border-radius: 20px; padding: 2rem 1.6rem 1.8rem; text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.ed-share-x { position: absolute; top: 0.8rem; right: 0.9rem; background: none; border: none; color: rgba(253, 246, 236, 0.5); font-size: 1rem; cursor: pointer; }
.ed-share-box h3 { font-family: 'Playfair Display', serif; font-size: 1.4rem; color: var(--cream); margin-bottom: 0.5rem; }
.ed-share-box > p { font-size: 0.88rem; color: rgba(253, 246, 236, 0.6); line-height: 1.6; margin-bottom: 1.2rem; }
.ed-share-row { display: flex; gap: 0.5rem; }
.ed-share-link { flex: 1; min-width: 0; background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(253, 246, 236, 0.12); border-radius: 10px; color: var(--gold); font-family: ui-monospace, monospace; font-size: 0.8rem; padding: 0.7rem 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-share-open { display: inline-block; margin-top: 1rem; color: var(--rose); font-size: 0.85rem; text-decoration: none; }
.ed-share-open:hover { text-decoration: underline; }
.ed-share-note { margin: 0.9rem 0 0; font-size: 0.75rem; color: rgba(253, 246, 236, 0.4); }
