:root {
  --bg: #fbf6ee;
  --surface: #ffffff;
  --ink: #2b2320;
  --muted: #7b6f68;
  --coral: #e8664f;
  --coral-dark: #c94f39;
  --sage: #6f9276;
  --gold: #d9a441;
  --line: #eadfd2;
  --shadow: 0 6px 24px rgba(43, 35, 32, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Rubik", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

h1, h2, .squared, .tab, .btn { font-family: "Secular One", "Rubik", sans-serif; font-weight: 400; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 56px 16px 36px;
  background:
    radial-gradient(circle at 15% 20%, rgba(232, 102, 79, 0.14), transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(111, 146, 118, 0.16), transparent 45%),
    radial-gradient(circle at 50% 100%, rgba(217, 164, 65, 0.16), transparent 50%);
}

.confetti {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(var(--coral) 2px, transparent 2.5px),
    radial-gradient(var(--sage) 2px, transparent 2.5px),
    radial-gradient(var(--gold) 2px, transparent 2.5px);
  background-size: 90px 90px, 130px 130px, 70px 70px;
  background-position: 10px 20px, 50px 60px, 30px 10px;
  opacity: 0.35;
}

.kicker { position: relative; margin: 0; color: var(--muted); font-size: 17px; }

.names {
  position: relative;
  margin: 6px 0 0;
  font-size: clamp(64px, 18vw, 120px);
  line-height: 1;
  display: flex; justify-content: center; align-items: baseline; gap: 0.18em;
}
.names .amp { color: var(--coral); font-size: 0.6em; }

.squared {
  position: relative;
  display: inline-block;
  margin: 10px 0 0;
  padding: 2px 16px;
  font-size: 22px;
  background: var(--ink); color: var(--bg);
  border-radius: 999px;
  transform: rotate(-4deg);
}
.squared sup { color: var(--gold); }

.tagline {
  position: relative;
  min-height: 1.5em;
  margin: 18px auto 0;
  max-width: 34ch;
  font-size: 19px;
  transition: opacity 0.4s;
}
.tagline.fade { opacity: 0; }

.date { position: relative; margin: 4px 0 0; color: var(--muted); }

.actions {
  position: relative;
  display: grid; gap: 12px;
  max-width: 420px; margin: 28px auto 0;
}

/* ---------- Buttons ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 19px;
  transition: transform 0.12s, background 0.2s, opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn-primary { background: var(--coral); color: #fff; box-shadow: 0 6px 18px rgba(232, 102, 79, 0.35); }
.btn-primary:hover { background: var(--coral-dark); }
.btn-secondary { background: var(--surface); color: var(--ink); border: 2px solid var(--ink); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-danger { background: #b3261e; color: #fff; font-size: 16px; padding: 8px 18px; }

/* ---------- Main ---------- */
main { max-width: 1100px; margin: 0 auto; padding: 0 16px 40px; }

.admin-badge {
  margin: 12px auto 0; width: fit-content;
  padding: 6px 14px; border-radius: 999px;
  background: #fff3cd; color: #7a5b00; font-size: 14px;
}

.tabs {
  position: sticky; top: 0; z-index: 5;
  display: flex; gap: 8px; justify-content: center;
  padding: 14px 0;
  background: linear-gradient(var(--bg) 75%, rgba(251, 246, 238, 0));
}
.tab {
  border: 0; cursor: pointer;
  padding: 8px 20px; border-radius: 999px;
  background: transparent; color: var(--muted);
  font-size: 18px;
}
.tab.active { background: var(--ink); color: var(--bg); }
.tab span { font-family: "Rubik", sans-serif; font-size: 14px; opacity: 0.8; }

.empty { text-align: center; color: var(--muted); font-size: 18px; padding: 40px 0; }

/* ---------- Gallery ---------- */
.gallery { columns: 2 160px; column-gap: 10px; }
@media (min-width: 700px) { .gallery { columns: 3 220px; column-gap: 14px; } }

.tile {
  position: relative;
  display: block; width: 100%;
  margin: 0 0 10px;
  padding: 0; border: 0; cursor: zoom-in;
  break-inside: avoid;
  border-radius: 14px; overflow: hidden;
  background: var(--line);
  box-shadow: var(--shadow);
  text-align: start;
  animation: pop 0.35s ease-out;
}
@media (min-width: 700px) { .tile { margin-bottom: 14px; } }
.tile img { display: block; width: 100%; height: auto; }
.tile .meta {
  position: absolute; inset: auto 0 0 0;
  padding: 28px 10px 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
  color: #fff; font-size: 13px; line-height: 1.35;
}
.tile .meta b { display: block; font-weight: 500; font-size: 14px; }

/* ---------- Message wall ---------- */
.wall { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.note {
  position: relative;
  padding: 18px 18px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  border-top: 6px solid var(--coral);
  animation: pop 0.35s ease-out;
}
.note:nth-child(3n+2) { border-top-color: var(--sage); }
.note:nth-child(3n) { border-top-color: var(--gold); }
.note p { margin: 0 0 10px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 17px; }
.note .from { color: var(--muted); font-size: 14px; }
.note .btn-danger { margin-top: 8px; }

@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Dialogs ---------- */
dialog { border: 0; padding: 0; color: var(--ink); }
dialog::backdrop { background: rgba(43, 35, 32, 0.55); }

.sheet {
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  border-radius: 24px;
  background: var(--bg);
}
.sheet form { display: grid; gap: 14px; padding: 22px 18px 18px; }
.sheet h2 { margin: 0; font-size: 26px; }
.sheet label { display: grid; gap: 6px; font-weight: 500; }

input[type="text"], textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 16px; font-weight: 400;
}
input[type="text"]:focus, textarea:focus { outline: none; border-color: var(--coral); }
textarea { resize: vertical; }

.dropzone {
  position: relative;
  display: block !important;
  padding: 22px 14px;
  border: 2px dashed var(--coral); border-radius: var(--radius);
  background: rgba(232, 102, 79, 0.06);
  text-align: center; cursor: pointer;
}
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-text { font-weight: 500; color: var(--coral-dark); }
.dz-text small { color: var(--muted); font-weight: 400; }
.previews { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.previews:not(:empty) { margin-top: 12px; }
.previews img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }

.form-error { margin: 0; color: #b3261e; font-weight: 500; }
.form-actions { display: flex; gap: 8px; }
.form-actions .btn-primary { flex: 1; }

/* ---------- Lightbox ---------- */
.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  background: rgba(15, 12, 11, 0.95);
  color: #fff;
}
.lightbox[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.lightbox img { max-width: calc(100vw - 32px); max-height: calc(100dvh - 160px); border-radius: 10px; }
.lb-meta { text-align: center; padding: 0 16px; }
.lb-caption { margin: 0; font-size: 18px; }
.lb-name { margin: 2px 0 10px; color: #cfc4bd; font-size: 14px; }
.lb-close {
  position: absolute; top: 12px; inset-inline-start: 12px;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.15); color: #fff; font-size: 20px; cursor: pointer;
}

/* ---------- Toast & footer ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50;
  transform: translate(-50%, 120px);
  max-width: calc(100vw - 32px);
  padding: 12px 20px; border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font-weight: 500; text-align: center;
  transition: transform 0.3s;
}
.toast.show { transform: translate(-50%, 0); }

.footer { text-align: center; color: var(--muted); font-size: 14px; padding: 24px 16px 40px; }
