/* =========================================================
   Annual Christmas Carol Sing — Cozy Mobile-First Theme
   ========================================================= */

:root {
  --pine-darkest: #081a13;
  --pine-dark: #0f2c20;
  --pine-mid: #184231;
  --pine-light: #245b44;

  --crimson-dark: #6f1419;
  --crimson: #9b1d24;
  --crimson-bright: #be2a33;

  --gold-dark: #a67827;
  --gold: #d9a441;
  --gold-light: #f4d382;
  --gold-glow: rgba(244, 211, 130, 0.35);

  --cream: #fdf8ee;
  --cream-warm: #f6ecd7;
  --cream-border: #e2cfa8;
  --ink: #241914;
  --ink-muted: #5d4a3f;

  --success: #1f6b43;
  --success-bg: #e7f6ed;
  --maybe: #9a6412;
  --maybe-bg: #fdf3de;
  --declined: #8c262c;
  --declined-bg: #fbeaea;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 18px 42px rgba(3, 12, 8, 0.45);
  --shadow-soft: 0 6px 18px rgba(3, 12, 8, 0.22);

  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-script: "Mountains of Christmas", "Great Vibes", Georgia, cursive;
  --font-body: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--cream);
  background:
    radial-gradient(circle at 50% 0%, rgba(217, 164, 65, 0.16) 0%, transparent 48%),
    radial-gradient(circle at 15% 30%, rgba(155, 29, 36, 0.14) 0%, transparent 45%),
    linear-gradient(180deg, var(--pine-darkest) 0%, var(--pine-dark) 42%, #0a1f16 100%);
  background-attachment: fixed;
  line-height: 1.55;
  overflow-x: hidden;
}

/* ---------- Snowfall Overlay ---------- */
.snow-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.snowflake {
  position: absolute;
  top: -12px;
  color: rgba(255, 250, 240, 0.72);
  user-select: none;
  animation-name: snowfall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes snowfall {
  0% {
    transform: translate3d(0, -10px, 0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.85;
  }
  90% {
    opacity: 0.75;
  }
  100% {
    transform: translate3d(var(--drift, 24px), 105vh, 0) rotate(360deg);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .snow-layer {
    display: none;
  }
  .bulb {
    animation: none !important;
  }
}

/* ---------- String Lights Header ---------- */
.string-lights {
  position: relative;
  z-index: 5;
  width: 100%;
  height: 36px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.string-lights svg {
  width: 100%;
  min-width: 420px;
  max-width: 960px;
  height: 36px;
}

.bulb {
  animation: twinkle 2.8s ease-in-out infinite alternate;
}

.bulb:nth-child(2n) { animation-delay: 0.6s; }
.bulb:nth-child(3n) { animation-delay: 1.3s; }
.bulb:nth-child(4n) { animation-delay: 2.0s; }

@keyframes twinkle {
  0% { opacity: 0.55; filter: drop-shadow(0 0 2px currentColor); }
  100% { opacity: 1; filter: drop-shadow(0 0 8px currentColor); }
}

/* ---------- Page Layout ---------- */
.page-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 6px 14px 48px;
}

.page-wrap.has-bottom-nav {
  padding-bottom: 96px;
}

.page-wrap.wide {
  max-width: 820px;
}

.center-screen {
  min-height: calc(100vh - 54px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* ---------- Parchment Invitation Card ---------- */
.card {
  position: relative;
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream-warm) 100%);
  color: var(--ink);
  border-radius: var(--radius-lg);
  padding: 22px 18px;
  box-shadow: var(--shadow-card);
  border: 2px solid var(--gold);
  margin-bottom: 18px;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(166, 120, 39, 0.35);
  border-radius: calc(var(--radius-lg) - 6px);
  pointer-events: none;
}

.card-dark {
  background: linear-gradient(165deg, rgba(24, 66, 49, 0.92), rgba(11, 34, 25, 0.95));
  color: var(--cream);
  border: 1.5px solid rgba(217, 164, 65, 0.55);
}

.card-dark::before {
  border-color: rgba(244, 211, 130, 0.18);
}

.card-inner {
  position: relative;
  z-index: 1;
}

/* ---------- Festive Headers & Typography ---------- */
.holly-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--crimson), var(--crimson-dark));
  color: var(--gold-light);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(111, 20, 25, 0.35);
  border: 1px solid rgba(244, 211, 130, 0.4);
}

.script-title {
  font-family: var(--font-script);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.display-title {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

.hero-header {
  text-align: center;
  padding: 6px 6px 14px;
}

.hero-header h1 {
  font-family: var(--font-script);
  font-size: clamp(2rem, 7.5vw, 2.9rem);
  color: var(--crimson);
  margin: 12px 0 6px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.hero-header.on-dark h1 {
  color: var(--gold-light);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.hero-subtitle {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink-muted);
  font-size: 1.02rem;
  margin: 0;
}

.hero-header.on-dark .hero-subtitle {
  color: rgba(253, 248, 238, 0.85);
}

.ornament-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 14px 0;
  color: var(--gold-dark);
}

.ornament-divider::before,
.ornament-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

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

.section-heading h2 {
  font-family: var(--font-display);
  font-size: 1.32rem;
  margin: 0;
  color: var(--crimson-dark);
}

.card-dark .section-heading h2 {
  color: var(--gold-light);
}

.muted {
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.card-dark .muted {
  color: rgba(253, 248, 238, 0.78);
}

/* ---------- Event Details Grid ---------- */
.details-list {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.detail-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--cream-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.detail-icon {
  font-size: 1.35rem;
  line-height: 1.2;
  flex-shrink: 0;
}

.detail-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--crimson);
  display: block;
}

.detail-value {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.98rem;
}

.event-note {
  background: rgba(155, 29, 36, 0.06);
  border-left: 3px solid var(--crimson);
  padding: 12px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.96rem;
  color: var(--ink);
  margin: 14px 0 6px;
  white-space: pre-line;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--font-body);
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
}

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

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--crimson-bright), var(--crimson-dark));
  color: #fffaf0;
  box-shadow: 0 6px 16px rgba(155, 29, 36, 0.32);
  border: 1px solid rgba(244, 211, 130, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #cf333c, var(--crimson));
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #241608;
  box-shadow: 0 6px 16px rgba(217, 164, 65, 0.3);
}

.btn-pine {
  background: linear-gradient(135deg, var(--pine-light), var(--pine-dark));
  color: var(--cream);
  border: 1px solid rgba(217, 164, 65, 0.45);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  border: 1.5px solid var(--cream-border);
}

.card-dark .btn-outline {
  background: rgba(255, 255, 255, 0.08);
  color: var(--cream);
  border-color: rgba(244, 211, 130, 0.35);
}

.btn-danger-ghost {
  background: transparent;
  color: var(--crimson);
  border: 1px solid rgba(155, 29, 36, 0.3);
  min-height: 36px;
  padding: 6px 11px;
  font-size: 0.82rem;
}

.btn-sm {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.84rem;
}

.btn-block {
  width: 100%;
}

/* ---------- Forms & Inputs ---------- */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.card-dark .form-group label {
  color: var(--gold-light);
}

.input,
.textarea,
.select {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--cream-border);
  background: #ffffff;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--crimson);
  box-shadow: 0 0 0 3px rgba(155, 29, 36, 0.14);
}

.textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}

.file-drop,
.form-group label.file-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px 14px;
  border: 2px dashed var(--gold-dark);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.65);
  text-align: center;
  cursor: pointer;
  margin-bottom: 0;
}

.file-drop input[type="file"] {
  display: none;
}

.file-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--pine-mid);
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* ---------- RSVP Picker ---------- */
.rsvp-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.rsvp-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 6px;
  border-radius: var(--radius-md);
  border: 2px solid var(--cream-border);
  background: #ffffff;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.rsvp-btn .emoji {
  font-size: 1.35rem;
}

.rsvp-btn.selected-attending {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success);
  box-shadow: 0 4px 12px rgba(31, 107, 67, 0.18);
}

.rsvp-btn.selected-maybe {
  background: var(--maybe-bg);
  border-color: var(--maybe);
  color: var(--maybe);
  box-shadow: 0 4px 12px rgba(154, 100, 18, 0.18);
}

.rsvp-btn.selected-declined {
  background: var(--declined-bg);
  border-color: var(--declined);
  color: var(--declined);
  box-shadow: 0 4px 12px rgba(140, 38, 44, 0.16);
}

.party-stepper {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 1.5px solid var(--cream-border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
}

.stepper-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: var(--cream-warm);
  color: var(--crimson-dark);
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
}

.stepper-val {
  min-width: 28px;
  text-align: center;
  font-weight: 800;
  font-size: 1.05rem;
}

/* ---------- Summary Pills & Badges ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.stat-box {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--cream-border);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  text-align: center;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--crimson);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 3px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-attending { background: var(--success-bg); color: var(--success); }
.status-maybe { background: var(--maybe-bg); color: var(--maybe); }
.status-declined { background: var(--declined-bg); color: var(--declined); }
.status-pending { background: #ece6dc; color: #675b51; }

/* ---------- Guest & Invite Lists ---------- */
.guest-list,
.song-list {
  display: grid;
  gap: 10px;
}

.guest-item {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--cream-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  min-width: 0;
  overflow: hidden;
}

.guest-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.guest-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  word-break: break-word;
}

.guest-meta {
  font-size: 0.84rem;
  color: var(--ink-muted);
  margin-top: 4px;
}

.guest-note-quote {
  margin-top: 6px;
  font-size: 0.88rem;
  font-style: italic;
  color: var(--pine-mid);
  background: rgba(24, 66, 49, 0.06);
  padding: 6px 10px;
  border-radius: 8px;
}

.invite-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
  min-width: 0;
}

.link-preview {
  flex: 1 1 100%;
  min-width: 0;
  max-width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  background: #f3ead8;
  color: var(--pine-dark);
  padding: 8px 10px;
  border-radius: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--cream-border);
}

/* ---------- Song Cards ---------- */
.song-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--cream-border);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 14px;
}

.song-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.song-title {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--crimson-dark);
  margin: 0;
}

.song-artist {
  font-size: 0.86rem;
  color: var(--ink-muted);
  margin-top: 2px;
}

.song-by {
  font-size: 0.8rem;
  color: var(--pine-mid);
  font-weight: 600;
  margin-top: 4px;
}

.song-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* ---------- Mobile Bottom Navigation ---------- */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  background: rgba(8, 26, 19, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1.5px solid rgba(217, 164, 65, 0.45);
  display: flex;
  justify-content: center;
  padding: 6px 10px calc(8px + env(safe-area-inset-bottom, 0px));
}

.bottom-nav-inner {
  width: 100%;
  max-width: 600px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 7px 6px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: rgba(253, 248, 238, 0.72);
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-tab .tab-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.nav-tab.active {
  background: rgba(217, 164, 65, 0.2);
  color: var(--gold-light);
}

/* ---------- Top Tabs (Host Dashboard) ---------- */
.top-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

@media (min-width: 560px) {
  .top-tabs {
    grid-template-columns: repeat(4, 1fr);
  }
}

.top-tab {
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(244, 211, 130, 0.35);
  background: rgba(15, 44, 32, 0.75);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.top-tab.active {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #241608;
  border-color: var(--gold-light);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Lyrics Sing-Along Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(5, 16, 11, 0.82);
  backdrop-filter: blur(6px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
}

.modal-backdrop.open {
  display: flex;
}

@media (min-width: 640px) {
  .modal-backdrop {
    align-items: center;
  }
}

.modal-sheet {
  width: 100%;
  max-width: 580px;
  max-height: 88vh;
  background: var(--cream);
  color: var(--ink);
  border-radius: var(--radius-lg);
  border: 2px solid var(--gold);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--crimson), var(--crimson-dark));
  color: var(--cream);
}

.modal-header h3 {
  font-family: var(--font-display);
  margin: 0;
  font-size: 1.2rem;
}

.modal-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
  flex: 1;
}

.lyrics-text {
  white-space: pre-wrap;
  font-family: var(--font-display);
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--ink);
}

/* ---------- Toast Notification ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%) translateY(20px);
  z-index: 80;
  background: var(--pine-darkest);
  color: var(--gold-light);
  border: 1.5px solid var(--gold);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: 92vw;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.alert-error {
  background: var(--declined-bg);
  color: var(--declined);
  border: 1px solid rgba(140, 38, 44, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
  display: none;
}

.alert-error.show {
  display: block;
}

.empty-state {
  text-align: center;
  padding: 24px 12px;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.footer-link {
  text-align: center;
  margin-top: 16px;
  font-size: 0.85rem;
}

.footer-link a {
  color: var(--gold-light);
  text-decoration: none;
  opacity: 0.85;
}

.footer-link a:hover {
  opacity: 1;
  text-decoration: underline;
}

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

.host-bar-title {
  font-family: var(--font-script);
  font-size: 1.75rem;
  color: var(--gold-light);
  margin: 0;
}
