/* Sparkles Party - midnight disco editorial theme */

:root {
  --bg: #131019;
  --bg-2: #1a1622;
  --card: #1e1927;
  --card-edge: #2e2738;
  --ink: #f3edE2;
  --ink-dim: #a89fb3;
  --gold: #f2c14e;
  --gold-soft: #f2c14e33;
  --coral: #ff5d73;
  --ok: #6fd08c;
  --warn: #ffb454;
  --radius: 14px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--ink);
  background:
    radial-gradient(1000px 500px at 85% -10%, #3b2a4d66, transparent 60%),
    radial-gradient(800px 400px at -10% 30%, #58223655, transparent 55%),
    radial-gradient(2px 2px at 20% 20%, #f2c14e55 50%, transparent 51%),
    radial-gradient(2px 2px at 70% 60%, #f2c14e40 50%, transparent 51%),
    radial-gradient(2px 2px at 40% 80%, #ffffff30 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 90% 35%, #ffffff28 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 10% 65%, #f2c14e33 50%, transparent 51%),
    var(--bg);
  background-attachment: fixed;
}

/* ---- Layout ---------------------------------------------------------- */

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 16px calc(84px + env(safe-area-inset-bottom));
}

body.anon .container { padding-bottom: 24px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 20px;
  background: #131019d9;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-edge);
}

.brand {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 900;
  font-size: 1.3rem;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: .02em;
}

.brand-spark { display: inline-block; animation: twinkle 2.4s ease-in-out infinite; }

@keyframes twinkle {
  0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }
  50% { opacity: .55; transform: scale(.82) rotate(20deg); }
}

.topnav { display: none; gap: 4px; flex: 1; }

.topnav a {
  color: var(--ink-dim);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 400;
}

.topnav a.on, .topnav a:hover { color: var(--ink); background: var(--card); }

.topbar .inline { margin-left: auto; }

@media (min-width: 720px) {
  .topnav { display: flex; }
  .bottomnav { display: none !important; }
  .container { padding-bottom: 40px; }
}

.bottomnav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-around;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  background: #17131fe6;
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--card-edge);
}

.bottomnav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 10px;
  color: var(--ink-dim);
  text-decoration: none;
  font-size: .68rem;
  border-radius: 10px;
}

.bottomnav a.on { color: var(--gold); }

.bottomnav svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- Typography ------------------------------------------------------ */

.display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.05;
}

.display em { font-style: italic; font-weight: 900; color: var(--gold); }

.page-title { font-size: 1.9rem; margin: 18px 0 20px; }

.section-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 12px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.sub-head {
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 700;
  margin: 16px 0 8px;
}

.count {
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 500;
  color: var(--gold);
  background: var(--gold-soft);
  padding: 2px 10px;
  border-radius: 999px;
}

.muted { color: var(--ink-dim); }
.prewrap { white-space: pre-wrap; margin: 0; }
.footnote { font-size: .8rem; text-align: center; margin-top: 24px; }

/* ---- Cards & sections ------------------------------------------------ */

.card {
  background: linear-gradient(160deg, var(--card), var(--bg-2));
  border: 1px solid var(--card-edge);
  border-radius: var(--radius);
  padding: 18px;
}

.section { margin-bottom: 16px; }

/* ---- Buttons & forms ------------------------------------------------- */

.btn {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: .92rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  color: var(--ink);
  background: none;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

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

.btn.primary {
  color: #241a05;
  background: linear-gradient(135deg, #f8d47a, var(--gold) 55%, #dfa32e);
  box-shadow: 0 4px 18px -4px #f2c14e66;
}

.btn.primary:hover { box-shadow: 0 6px 22px -4px #f2c14e99; }

.btn.ghost { border-color: var(--card-edge); color: var(--ink); }
.btn.ghost:hover { background: var(--card); }

.btn.danger { border-color: #ff5d7355; color: var(--coral); }
.btn.danger:hover { background: #ff5d7314; }

.btn.small { padding: 6px 14px; font-size: .82rem; }
.btn.big { padding: 13px 24px; font-size: 1rem; width: 100%; }

.link {
  background: none;
  border: none;
  color: var(--ink-dim);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  padding: 4px;
}

.link.on { color: var(--gold); text-decoration: none; }

.inline { display: inline; }
.push-right { margin-left: auto; }

label {
  display: block;
  font-size: .85rem;
  font-weight: 500;
  color: var(--ink-dim);
  margin-bottom: 14px;
}

label small { font-weight: 300; }

input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 14px;
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--card-edge);
  border-radius: 10px;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

input::placeholder, textarea::placeholder { color: #6d6478; }

label.check {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

label.check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--gold);
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-card { margin-bottom: 16px; }

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 4px;
}

.grid-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
  align-items: end;
  margin-top: 12px;
}

.grid-form button { margin-bottom: 14px; }

@media (max-width: 480px) {
  .grid-form { grid-template-columns: 1fr; }
}

.add-row { display: flex; gap: 10px; margin-top: 14px; }
.add-row select { flex: 1; margin-top: 0; }

.danger-zone { text-align: center; margin-top: 8px; }

.alert {
  background: #ff5d7318;
  border: 1px solid #ff5d7355;
  color: var(--coral);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: .9rem;
  margin: 0 0 14px;
}

.alert.ok { background: #6fd08c18; border-color: #6fd08c55; color: var(--ok); }

/* ---- Auth pages ------------------------------------------------------ */

.auth-wrap { max-width: 400px; margin: 0 auto; padding-top: 7vh; }

.auth-hero { text-align: center; margin-bottom: 26px; }

.auth-hero .display { font-size: 2.8rem; margin: 8px 0 6px; }

.auth-spark {
  font-size: 2rem;
  color: var(--gold);
  animation: twinkle 2.4s ease-in-out infinite;
}

.tagline { color: var(--ink-dim); margin: 0; }

.auth-card { padding: 24px; }

.auth-switch {
  display: block;
  text-align: center;
  margin-top: 16px;
  color: var(--ink-dim);
  font-size: .88rem;
}

.lang-switch {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  color: var(--ink-dim);
}

/* ---- Calendar -------------------------------------------------------- */

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

.party-card {
  display: flex;
  gap: 16px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  transition: transform .12s ease, border-color .12s ease;
}

.party-card:hover { transform: translateY(-2px); border-color: var(--gold); }

.party-card.faded { opacity: .6; }

.party-card h2 {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 2px;
}

.party-card .loc { margin: 0 0 8px; color: var(--ink-dim); font-size: .88rem; }

.date-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
  padding: 10px 8px;
  border-radius: 12px;
  background: var(--gold-soft);
  border: 1px solid #f2c14e40;
}

.date-badge .d {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.5rem;
  color: var(--gold);
  line-height: 1;
}

.date-badge .m { font-size: .75rem; color: var(--ink); margin-top: 2px; }
.date-badge .y { font-size: .65rem; color: var(--ink-dim); }

.past-block { margin-top: 26px; }
.past-block summary { cursor: pointer; margin-bottom: 12px; }

.empty { text-align: center; padding: 40px 20px; }
.empty .btn { margin-top: 14px; }

.empty-spark {
  font-size: 2.4rem;
  color: var(--gold);
  animation: twinkle 2.4s ease-in-out infinite;
}

/* ---- Party detail ---------------------------------------------------- */

.party-hero { margin: 20px 0 20px; }

.party-hero .display { font-size: 2.2rem; font-style: italic; margin: 0 0 8px; }

.party-meta { color: var(--ink-dim); margin: 0 0 16px; }
.party-meta .dot { color: var(--gold); }

.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

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

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--card-edge);
  font-size: .82rem;
  font-weight: 400;
}

.chip.range { color: var(--gold); border-color: #f2c14e40; }

.chip.person a { color: var(--ink); text-decoration: none; font-weight: 500; }
.chip.person a:hover { color: var(--gold); }

.chip-x {
  background: none;
  border: none;
  color: var(--ink-dim);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 2px;
  line-height: 1;
}

.chip-x:hover { color: var(--coral); }

.rows { list-style: none; margin: 0; padding: 0; }

.row { padding: 12px 0; border-bottom: 1px solid var(--card-edge); }
.row:last-child { border-bottom: none; }

.row-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.row-main a { color: var(--ink); text-decoration: none; }
.row-main .arrow { color: var(--gold); }
.price { font-weight: 500; color: var(--gold); }

.row-sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
  font-size: .82rem;
  color: var(--ink-dim);
}

.badge {
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
}

.badge.ok { color: var(--ok); background: #6fd08c1a; border: 1px solid #6fd08c44; }
.badge.warn { color: var(--warn); background: #ffb4541a; border: 1px solid #ffb45444; }

button.badge { cursor: pointer; font-family: inherit; }

.room-guests { margin-top: 10px; }
.room-guests .sub-label {
  display: block;
  font-size: .82rem;
  color: var(--ink-dim);
  margin-bottom: 6px;
}
.room-guests .chips { margin-bottom: 8px; }

.row-edit { margin-top: 8px; }

.row-edit summary {
  cursor: pointer;
  font-size: .8rem;
  color: var(--ink-dim);
  width: fit-content;
}

.row-edit summary:hover { color: var(--gold); }

.row-edit .inline { margin-top: 4px; display: block; }

.add-block { margin-top: 14px; }

.add-block > summary {
  list-style: none;
  width: fit-content;
}

.add-block > summary::-webkit-details-marker { display: none; }

.links { list-style: none; margin: 0; padding: 0; }
.links li { margin-bottom: 6px; overflow-wrap: anywhere; }
.links a { color: var(--gold); }

/* ---- WhatsApp ---------------------------------------------------------- */

.whatsapp-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.qr-box {
  background: #ffffff;
  border-radius: 12px;
  padding: 8px;
  width: 140px;
  height: 140px;
  flex-shrink: 0;
}

.qr-box img { width: 100%; height: 100%; display: block; }

.whatsapp-info { flex: 1; min-width: 180px; }
.whatsapp-info p { margin: 0 0 10px; }

.btn.whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0b2e13;
  background: linear-gradient(135deg, #4ade80, #25d366 60%, #1faa52);
  box-shadow: 0 4px 18px -4px #25d36655;
}

.btn.whatsapp svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- Photos ----------------------------------------------------------- */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.photo-item { position: relative; aspect-ratio: 1; }

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--card-edge);
  display: block;
}

.photo-actions {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: flex;
  gap: 6px;
}

.photo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  color: var(--ink);
  background: #131019cc;
  backdrop-filter: blur(4px);
}

.photo-btn:hover { color: var(--gold); }

.photo-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.add-row input[type="file"] { flex: 1; margin-top: 0; }

/* ---- Team & profiles ------------------------------------------------- */

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.member-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  transition: transform .12s ease, border-color .12s ease;
}

.member-card:hover { transform: translateY(-2px); border-color: var(--gold); }

.member-name { font-weight: 500; text-align: center; }

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: #241a05;
  background: linear-gradient(135deg, #f8d47a, var(--gold) 55%, #dfa32e);
  text-transform: uppercase;
}

img.avatar { object-fit: cover; border: 1px solid var(--card-edge); }

.avatar.big { width: 72px; height: 72px; font-size: 1.5rem; }

.avatar.mini { width: 22px; height: 22px; font-size: .6rem; margin-left: -4px; }

.avatar-edit {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.avatar-fields { flex: 1; }
.avatar-fields label:last-child { margin-bottom: 0; }

.camera { margin-bottom: 14px; }
.camera video {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--card-edge);
  background: #000;
  transform: scaleX(-1); /* mirror the self-facing preview */
}
.camera-actions { display: flex; gap: 10px; margin-top: 10px; }

input[type="file"] { padding: 8px; }
input[type="file"]::file-selector-button {
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-radius: 999px;
  padding: 6px 14px;
  margin-right: 10px;
  cursor: pointer;
}

.profile-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 24px 0 20px;
  text-align: center;
}

.profile-head .display { margin: 0; font-size: 1.8rem; }

.info-list { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 12px 18px; }

.info-list dt { color: var(--ink-dim); font-size: .85rem; }
.info-list dd { margin: 0; overflow-wrap: anywhere; }
.info-list a { color: var(--gold); }

/* ---- Admin ----------------------------------------------------------- */

.reg-code {
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 1rem;
  letter-spacing: .12em;
  color: var(--gold);
  background: var(--gold-soft);
  padding: 4px 10px;
  border-radius: 8px;
}
