:root {
  --bg-deep: #061812;
  --bg-mid: #0c271d;
  --bg-card: rgba(13, 39, 30, 0.84);
  --bg-elevated: rgba(19, 52, 40, 0.9);
  --border-gold: rgba(212, 175, 55, 0.28);
  --border-soft: rgba(246, 241, 231, 0.12);
  --gold: #e0bd5b;
  --gold-bright: #f4da88;
  --crimson: #a82434;
  --crimson-hover: #c32c3f;
  --text-main: #f6f1e7;
  --text-muted: #b7c6be;
  --success: #79d29c;
  --danger: #f08a8a;
  --radius-lg: 20px;
  --radius-md: 12px;
  --shadow-card: 0 18px 48px rgba(0, 0, 0, 0.42);
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 15% 12%, rgba(168, 36, 52, 0.16) 0%, transparent 42%),
    radial-gradient(circle at 85% 18%, rgba(224, 189, 91, 0.13) 0%, transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(19, 68, 51, 0.45) 0%, transparent 60%),
    linear-gradient(165deg, #05130e 0%, #0a2219 52%, #071913 100%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

#snow-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 40;
}

.page-shell {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 20px 18px 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  text-decoration: none;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-star {
  color: var(--gold);
  font-size: 1.3rem;
}

.header-pill {
  font-size: 0.85rem;
  color: var(--gold-bright);
  background: rgba(224, 189, 91, 0.11);
  border: 1px solid var(--border-gold);
  padding: 6px 14px;
  border-radius: 999px;
}

.container {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 12px 18px 40px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.site-footer {
  text-align: center;
  padding: 18px 16px 26px;
  color: var(--text-muted);
  font-size: 0.84rem;
  opacity: 0.85;
}

h1, h2, h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  margin: 0 0 10px;
  font-weight: 700;
  line-height: 1.18;
  color: var(--text-main);
}

h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.5rem, 3vw, 1.95rem); }
h3 { font-size: 1.35rem; }
h4, h5 { margin: 0 0 8px; font-weight: 600; color: var(--gold-bright); }

p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

.muted { color: var(--text-muted); font-size: 0.95rem; }
.text-gold { color: var(--gold-bright); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
}

.hero-card {
  text-align: center;
  padding: 36px 24px;
  background:
    radial-gradient(circle at top center, rgba(224, 189, 91, 0.14), transparent 60%),
    var(--bg-card);
}

.hero-ornament {
  color: var(--gold);
  letter-spacing: 0.35em;
  font-size: 1.05rem;
  margin-bottom: 10px;
}

.hero-title { margin-bottom: 12px; }

.hero-subtitle {
  max-width: 580px;
  margin: 0 auto 20px;
  color: var(--text-muted);
}

.info-badge {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-soft);
  margin-bottom: 22px;
  font-size: 0.92rem;
}

.welcome-back {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.welcome-note { font-size: 1.05rem; margin: 0; }

.landing-hint {
  margin-top: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.22);
  border: 1px dashed var(--border-gold);
  color: var(--text-muted);
  display: inline-block;
}

.status-card {
  text-align: center;
}

.status-pill {
  display: inline-block;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(224, 189, 91, 0.14);
  color: var(--gold-bright);
  border: 1px solid var(--border-gold);
  margin-bottom: 14px;
}

.status-pill-done {
  background: rgba(121, 210, 156, 0.14);
  color: var(--success);
  border-color: rgba(121, 210, 156, 0.35);
}

.eyebrow {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 4px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.section-head h2 { margin-bottom: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-wait {
  background: rgba(224, 189, 91, 0.15);
  color: var(--gold-bright);
  border: 1px solid var(--border-gold);
}

.badge-ready {
  background: rgba(121, 210, 156, 0.15);
  color: var(--success);
  border: 1px solid rgba(121, 210, 156, 0.35);
}

.badge-shield {
  background: rgba(168, 36, 52, 0.25);
  color: #ffd5da;
  border: 1px solid rgba(195, 44, 63, 0.45);
}

.privacy-note {
  font-size: 0.84rem;
  color: var(--gold-bright);
  background: rgba(224, 189, 91, 0.1);
  padding: 4px 12px;
  border-radius: 999px;
}

/* Flash messages */
.flash-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.flash {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.94rem;
  border: 1px solid transparent;
}

.flash-success {
  background: rgba(28, 86, 56, 0.88);
  border-color: rgba(121, 210, 156, 0.4);
  color: #ebfff2;
}

.flash-error {
  background: rgba(114, 24, 34, 0.9);
  border-color: rgba(240, 138, 138, 0.45);
  color: #ffecee;
}

.flash-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.14s ease, background 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; }

.btn-lg { padding: 13px 26px; font-size: 1rem; }
.btn-sm { padding: 7px 13px; font-size: 0.84rem; border-radius: 9px; }
.btn-xs { padding: 5px 10px; font-size: 0.78rem; border-radius: 8px; }
.btn-full { width: 100%; }

.btn-gold {
  background: linear-gradient(135deg, #e7c667 0%, #c89d34 100%);
  color: #1b1404;
  box-shadow: 0 6px 20px rgba(224, 189, 91, 0.25);
}
.btn-gold:hover:not(:disabled) {
  background: linear-gradient(135deg, #f3d77f 0%, #d4a83d 100%);
}

.btn-crimson {
  background: linear-gradient(135deg, var(--crimson-hover) 0%, var(--crimson) 100%);
  color: #fff6f7;
  box-shadow: 0 6px 20px rgba(168, 36, 52, 0.32);
}
.btn-crimson:hover:not(:disabled) {
  background: linear-gradient(135deg, #d63549 0%, #b52637 100%);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-soft);
  color: var(--text-main);
}
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.13); }

.btn-danger {
  background: rgba(168, 36, 52, 0.22);
  border-color: rgba(240, 138, 138, 0.32);
  color: #ffd0d4;
}
.btn-danger:hover:not(:disabled) { background: rgba(168, 36, 52, 0.4); }

/* Countdown */
.countdown {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0 12px;
}

.cd-box {
  min-width: 78px;
  padding: 14px 12px;
  border-radius: 14px;
  background: rgba(4, 17, 12, 0.65);
  border: 1px solid var(--border-gold);
  text-align: center;
}

.cd-num {
  display: block;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--gold-bright);
  line-height: 1;
}

.cd-lbl {
  display: block;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-top: 6px;
}

.countdown-meta {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Sealed Envelope */
.envelope-sealed-box {
  text-align: center;
  padding: 24px 14px 10px;
  transition: transform 0.42s ease, opacity 0.42s ease;
}

.envelope-sealed-box.opening {
  transform: scale(1.04) translateY(-8px);
  opacity: 0;
}

.envelope-visual {
  position: relative;
  width: 210px;
  height: 136px;
  margin: 0 auto 18px;
  border-radius: 12px;
  background: linear-gradient(160deg, #98202f 0%, #6d131f 100%);
  border: 1px solid rgba(244, 218, 136, 0.5);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.env-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 76px;
  background: linear-gradient(180deg, #b5293b 0%, #831926 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  border-bottom: 1px solid rgba(244, 218, 136, 0.35);
  transition: transform 0.38s ease;
  transform-origin: top center;
}

.envelope-sealed-box.opening .env-flap {
  transform: rotateX(160deg);
}

.env-seal {
  position: absolute;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fae397, #c2922a);
  color: #2b1a04;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

.envelope-caption {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 14px;
}

.envelope-letter {
  background: rgba(7, 25, 19, 0.78);
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  padding: 22px;
}

.envelope-letter.reveal-in {
  animation: letterReveal 0.42s ease forwards;
}

@keyframes letterReveal {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.letter-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-soft);
}

.recipient-name {
  font-size: clamp(1.7rem, 3.5vw, 2.2rem);
  color: var(--gold-bright);
  margin: 0;
}

/* Forms & Inputs */
.stack-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 6px;
}

.field-help {
  display: block;
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

input[type="text"],
input[type="url"],
input[type="datetime-local"],
textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(246, 241, 231, 0.18);
  background: rgba(4, 15, 11, 0.72);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(224, 189, 91, 0.16);
}

input:disabled, textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

textarea { resize: vertical; min-height: 120px; }

.form-row-between {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.char-counter {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.inline-grid-form {
  display: grid;
  grid-template-columns: 1fr 1.2fr auto;
  gap: 10px;
  margin-top: 14px;
}

.add-participant-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 18px;
}

.divider {
  border: 0;
  border-top: 1px solid var(--border-soft);
  margin: 24px 0;
}

/* Wishlist Display */
.wishlist-text-rendered {
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(4, 16, 12, 0.55);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 0.96rem;
}

.wishlist-text-rendered a {
  color: var(--gold-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.preview-box {
  margin-top: 16px;
}

.preview-title {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.sub-block { margin-top: 18px; }

.link-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.link-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 11px;
  background: rgba(4, 16, 12, 0.58);
  border: 1px solid var(--border-soft);
}

.gift-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  text-decoration: none;
  flex: 1;
}

.gift-link-title {
  color: var(--gold-bright);
  font-weight: 600;
}

.gift-link-url {
  color: var(--text-muted);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Photos */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.photo-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-soft);
}

.photo-thumb-btn {
  padding: 0;
  border: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  cursor: zoom-in;
  display: block;
}

.photo-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.photo-thumb-btn:hover img { transform: scale(1.04); }

.photo-delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(16, 16, 16, 0.78);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-delete-btn:hover { background: var(--crimson); }

.upload-form {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.file-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 18px 14px;
  border-radius: 12px;
  border: 1.5px dashed var(--border-gold);
  background: rgba(4, 16, 12, 0.45);
  cursor: pointer;
}

.file-drop input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.file-drop-title { font-weight: 600; color: var(--gold-bright); font-size: 0.94rem; }
.file-drop-sub { font-size: 0.82rem; color: var(--text-muted); }

/* Admin */
.admin-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
}

.draw-status-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(4, 16, 12, 0.55);
  border: 1px solid var(--border-soft);
  margin-bottom: 16px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.92rem;
}

.draw-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.participants-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.participant-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 13px;
  background: rgba(4, 16, 12, 0.58);
  border: 1px solid var(--border-soft);
}

.participant-name-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.participant-name { font-size: 1.05rem; }

.status-dot {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}

.status-dot-filled {
  background: rgba(121, 210, 156, 0.16);
  color: var(--success);
}

.status-dot-empty {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.participant-counts {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.participant-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.empty-state {
  padding: 16px;
  border-radius: 12px;
  background: rgba(4, 16, 12, 0.42);
  color: var(--text-muted);
  text-align: center;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 10, 8, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox[hidden] { display: none; }

.lightbox img {
  max-width: 94vw;
  max-height: 88vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.lightbox-close {
  position: fixed;
  top: 16px;
  right: 20px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 110;
  background: rgba(19, 58, 42, 0.96);
  color: var(--gold-bright);
  border: 1px solid var(--border-gold);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

@media (max-width: 760px) {
  .admin-grid { grid-template-columns: 1fr; }
  .inline-grid-form { grid-template-columns: 1fr; }
  .add-participant-form { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .cd-box { min-width: 68px; padding: 10px 8px; }
  .cd-num { font-size: 1.8rem; }
}
