/* ============================================================
   Razz's 8th — Legend of Zelda birthday evite
   Palette pulled from the BotW hero art: twilight navy ground,
   Triforce gold, warm cream, a whisper of Sheikah teal.
   ============================================================ */

:root {
  --night: #0a1520;
  --night-2: #0f2030;
  --night-3: #16293c;
  --panel: rgba(13, 26, 40, 0.82);
  --panel-edge: rgba(232, 193, 90, 0.38);
  --gold: #e8c15a;
  --gold-deep: #b8892b;
  --gold-glow: rgba(232, 193, 90, 0.22);
  --cream: #f0e6cf;
  --cream-dim: #c9bda0;
  --teal: #8fd0c6;
  --danger: #e07a6a;
  --ok: #7fc98a;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--cream);
  font-family: "Spectral", Georgia, serif;
  font-size: 1.06rem;
  line-height: 1.6;
  background:
    radial-gradient(ellipse 120% 55% at 50% -10%, #2b3a52 0%, transparent 60%),
    linear-gradient(180deg, var(--night) 0%, var(--night-2) 45%, var(--night-3) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

h1, h2, h3, .display {
  font-family: "Cinzel", "Trajan Pro", serif;
  font-weight: 700;
  letter-spacing: 0.04em;
}

a { color: var(--gold); }
a:hover { color: #f4d98c; }

/* ---------- twinkling stars + rising motes ---------- */

.stars, .stars::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 22%, rgba(240, 230, 207, 0.9), transparent 100%),
    radial-gradient(1px 1px at 34% 8%, rgba(240, 230, 207, 0.7), transparent 100%),
    radial-gradient(1.4px 1.4px at 55% 30%, rgba(240, 230, 207, 0.8), transparent 100%),
    radial-gradient(1px 1px at 71% 12%, rgba(240, 230, 207, 0.6), transparent 100%),
    radial-gradient(1.3px 1.3px at 88% 26%, rgba(240, 230, 207, 0.85), transparent 100%),
    radial-gradient(1px 1px at 20% 55%, rgba(240, 230, 207, 0.5), transparent 100%),
    radial-gradient(1.2px 1.2px at 65% 62%, rgba(240, 230, 207, 0.6), transparent 100%),
    radial-gradient(1px 1px at 92% 70%, rgba(240, 230, 207, 0.5), transparent 100%);
  animation: twinkle 5s ease-in-out infinite alternate;
}

.stars::after {
  background-image:
    radial-gradient(1.5px 1.5px at 8% 78%, var(--gold-glow), transparent 100%),
    radial-gradient(2px 2px at 42% 88%, rgba(232, 193, 90, 0.35), transparent 100%),
    radial-gradient(1.5px 1.5px at 78% 84%, rgba(232, 193, 90, 0.3), transparent 100%),
    radial-gradient(2px 2px at 28% 40%, rgba(232, 193, 90, 0.25), transparent 100%),
    radial-gradient(1.5px 1.5px at 60% 18%, rgba(232, 193, 90, 0.3), transparent 100%);
  animation: drift 18s linear infinite;
}

@keyframes twinkle {
  from { opacity: 0.55; }
  to   { opacity: 1; }
}

@keyframes drift {
  from { transform: translateY(0); }
  to   { transform: translateY(-60px); }
}

@media (prefers-reduced-motion: reduce) {
  .stars, .stars::after { animation: none; }
}

/* ---------- page shell ---------- */

.page {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 2.2rem 1.2rem 3rem;
}

.title {
  text-align: center;
  font-size: clamp(1.7rem, 5.5vw, 2.5rem);
  margin: 0.4rem 0 1.4rem;
  background: linear-gradient(180deg, #f6dd94 20%, var(--gold) 55%, var(--gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 10px rgba(232, 193, 90, 0.25));
}

.section-title {
  text-align: center;
  font-size: clamp(1.3rem, 4vw, 1.7rem);
  margin: 0 0 1.1rem;
  background: linear-gradient(180deg, #f6dd94 20%, var(--gold) 55%, var(--gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- hero invite ---------- */

.hero-frame {
  display: block;
  position: relative;
  border-radius: 10px;
  padding: 8px;
  background: linear-gradient(160deg, rgba(232, 193, 90, 0.5), rgba(184, 137, 43, 0.25) 45%, rgba(232, 193, 90, 0.5));
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.55),
    0 0 90px var(--gold-glow);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.hero-frame:hover {
  transform: translateY(-3px);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.6),
    0 0 120px rgba(232, 193, 90, 0.32);
}

.hero-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 5px;
}

/* gold corner brackets, a nod to the Sheikah slate frame */
.hero-frame::before,
.hero-frame::after {
  content: "";
  position: absolute;
  width: 34px;
  height: 34px;
  pointer-events: none;
}
.hero-frame::before {
  top: -6px; left: -6px;
  border-top: 3px solid var(--gold);
  border-left: 3px solid var(--gold);
  border-top-left-radius: 8px;
}
.hero-frame::after {
  bottom: -6px; right: -6px;
  border-bottom: 3px solid var(--gold);
  border-right: 3px solid var(--gold);
  border-bottom-right-radius: 8px;
}

.invite-lede {
  text-align: center;
  max-width: 34rem;
  margin: 1.6rem auto 0.4rem;
  font-size: 1.12rem;
}

.welcome-note {
  margin-top: 0.5rem;
  font-size: 0.98rem;
  font-style: italic;
  color: var(--teal);
}

.invite-lede .golden {
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ---------- detail tickets ---------- */

.tickets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin: 1.6rem 0 0;
}

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

.ticket {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 10px;
  padding: 1rem 1.1rem 1.05rem;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.ticket-label {
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.35rem;
}

.ticket-value {
  font-family: "Cinzel", serif;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--gold);
}

.ticket-sub {
  font-size: 0.94rem;
  color: var(--cream-dim);
  margin-top: 0.25rem;
}

/* ---------- triforce divider ---------- */

.triforce-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 2.4rem 0;
}

.triforce-divider::before,
.triforce-divider::after {
  content: "";
  height: 1px;
  width: min(130px, 26vw);
  background: linear-gradient(90deg, transparent, var(--panel-edge));
}
.triforce-divider::after {
  background: linear-gradient(90deg, var(--panel-edge), transparent);
}

.triforce-divider svg {
  filter: drop-shadow(0 0 8px rgba(232, 193, 90, 0.45));
}

/* ---------- hearts ---------- */

.hearts-row {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  margin: -0.4rem 0 1rem;
}

.hearts-row svg {
  filter: drop-shadow(0 1px 4px rgba(224, 90, 90, 0.4));
}

/* ---------- quest card (forms) ---------- */

.quest-card {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 14px;
  padding: 1.6rem 1.5rem;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.45);
}

.quest-card h3 {
  margin-top: 0;
  color: var(--gold);
}

.field { margin-bottom: 1.1rem; }

.field label {
  display: block;
  font-family: "Cinzel", serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.4rem;
}

.field input[type="text"],
.field input[type="number"],
.field input[type="password"],
.field textarea {
  width: 100%;
  background: rgba(8, 16, 26, 0.85);
  border: 1px solid rgba(232, 193, 90, 0.28);
  border-radius: 8px;
  color: var(--cream);
  font-family: inherit;
  font-size: 1rem;
  padding: 0.65rem 0.8rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field textarea { min-height: 5.2rem; resize: vertical; }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232, 193, 90, 0.18);
}

/* radio pills */
.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.choice-row input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice {
  cursor: pointer;
  border: 1px solid rgba(232, 193, 90, 0.35);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  text-transform: none;
  font-family: "Spectral", Georgia, serif;
  color: var(--cream);
  background: rgba(8, 16, 26, 0.6);
  transition: all 0.2s ease;
}

.choice-row input[type="radio"]:checked + .choice {
  background: linear-gradient(180deg, #f2d27c, var(--gold) 55%, var(--gold-deep));
  border-color: var(--gold);
  color: #241a05;
  font-weight: 600;
  box-shadow: 0 0 18px rgba(232, 193, 90, 0.35);
}

.choice-row input[type="radio"]:focus-visible + .choice {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* gold quest button */
.quest-btn {
  display: block;
  width: 100%;
  cursor: pointer;
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #241a05;
  background: linear-gradient(180deg, #f6dd94, var(--gold) 50%, var(--gold-deep));
  border: 1px solid rgba(120, 86, 20, 0.8);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 245, 214, 0.7);
  transition: transform 0.15s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.quest-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45), 0 0 30px rgba(232, 193, 90, 0.35);
}

.quest-btn:disabled { opacity: 0.65; cursor: default; }

.form-status { min-height: 1.4rem; margin: 0.7rem 0 0; text-align: center; }
.form-status.error { color: var(--danger); }
.form-status.ok { color: var(--ok); }

/* RSVP success */
.quest-done {
  text-align: center;
  padding: 0.6rem 0.2rem;
}
.quest-done .fanfare { font-size: 2.4rem; display: block; margin-bottom: 0.4rem; }
.quest-done h4 {
  font-family: "Cinzel", serif;
  color: var(--gold);
  font-size: 1.25rem;
  margin: 0 0 0.4rem;
}

/* ---------- map ---------- */

.map-frame {
  border-radius: 12px;
  padding: 6px;
  background: linear-gradient(160deg, rgba(232, 193, 90, 0.45), rgba(184, 137, 43, 0.2) 50%, rgba(232, 193, 90, 0.45));
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

#map {
  height: 300px;
  border-radius: 8px;
  z-index: 1; /* keep Leaflet panes under the fixed starfield's siblings */
}

.map-caption { text-align: center; margin-top: 0.8rem; }

/* ---------- guest log ---------- */

.guest-total {
  text-align: center;
  color: var(--teal);
  font-style: italic;
  margin: 0 0 1.3rem;
}

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

.guest-log li {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.2rem;
  border-bottom: 1px solid rgba(232, 193, 90, 0.14);
}
.guest-log li:last-child { border-bottom: none; }

.guest-name { flex: 1; font-weight: 600; font-size: 1.05rem; }
.guest-party { color: var(--cream-dim); font-size: 0.9rem; font-style: italic; }

/* rupee badge — hexagonal gem, color varies per guest */
.rupee {
  flex: none;
  width: 26px;
  height: 38px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.rupee-green  { background: linear-gradient(160deg, #7ede6c, #2e9e3f 60%, #1c6b2a); }
.rupee-blue   { background: linear-gradient(160deg, #6ec3ef, #2d7dc4 60%, #1b4f85); }
.rupee-red    { background: linear-gradient(160deg, #ef8d7a, #c43f2d 60%, #85221b); }
.rupee-purple { background: linear-gradient(160deg, #c08aec, #7e3fc4 60%, #4f1b85); }
.rupee-silver { background: linear-gradient(160deg, #e8ecf0, #9aa7b4 60%, #5d6a78); }
.rupee-gold   { background: linear-gradient(160deg, #f6dd94, #d1a232 60%, #8a6512); }

.empty-log {
  text-align: center;
  font-style: italic;
  color: var(--cream-dim);
}

/* ---------- nav + footer ---------- */

.site-nav {
  text-align: center;
  margin: 2.2rem 0 0;
  font-family: "Cinzel", serif;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
}

.site-nav a { text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }

.motto {
  text-align: center;
  margin-top: 2.6rem;
  color: var(--cream-dim);
  font-style: italic;
  font-size: 0.95rem;
  opacity: 0.85;
}

/* ---------- admin ---------- */

.admin-grid { display: grid; gap: 1.2rem; }

.table-wrap { overflow-x: auto; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.admin-table th {
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--panel-edge);
}

.admin-table td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid rgba(232, 193, 90, 0.12);
  vertical-align: top;
}

.notes-cell { max-width: 220px; overflow-wrap: anywhere; font-size: 0.9rem; color: var(--cream-dim); }

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 0.12rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
}
.pill.yes { background: rgba(127, 201, 138, 0.16); color: var(--ok); border: 1px solid rgba(127, 201, 138, 0.4); }
.pill.no  { background: rgba(224, 122, 106, 0.14); color: var(--danger); border: 1px solid rgba(224, 122, 106, 0.4); }

.banish-btn {
  cursor: pointer;
  background: none;
  border: 1px solid rgba(224, 122, 106, 0.5);
  border-radius: 7px;
  color: var(--danger);
  font-family: inherit;
  font-size: 0.82rem;
  padding: 0.25rem 0.6rem;
  transition: all 0.2s ease;
}
.banish-btn:hover:not(:disabled) { background: rgba(224, 122, 106, 0.15); }

.gate-shake { animation: gate-shake 0.4s ease; }
@keyframes gate-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}
