:root {
  --rose-dark: #C2185B;
  --rose: #FF4FA0;
  --gold: #FFB300;
  --gold-light: #FFE082;
  --cream: #FFF3E0;
  --ink: #3a1030;
  --ok: #2E9E5B;
  --err: #E53950;
  --shadow: 0 10px 30px rgba(194, 24, 91, 0.22);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: radial-gradient(circle at 50% -10%, #fff0f6 0%, #ffe0ec 45%, #ffd54f 130%);
  color: var(--ink);
  font-family: "Aptos Display", Aptos, "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
}

.serif {
  font-family: "Aptos Display", Aptos, "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  font-weight: 700;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px 60px;
}

.top-ornament {
  font-size: 28px;
  letter-spacing: 6px;
  color: var(--gold);
  margin-bottom: 6px;
}

h1.title {
  font-size: clamp(2rem, 6vw, 3.6rem);
  text-align: center;
  color: var(--rose-dark);
  margin: 0 0 4px;
  line-height: 1.1;
}

h1.title .name {
  color: var(--rose);
  font-style: italic;
}

.subtitle {
  text-align: center;
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  color: var(--rose);
  margin: 0 0 28px;
}

.card {
  background: #fffdf9;
  border: 1px solid var(--gold-light);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 28px;
  max-width: 560px;
  width: 100%;
}

.qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.qr-wrap img {
  width: min(70vw, 340px);
  height: auto;
  border-radius: 14px;
  border: 6px solid #fff;
  box-shadow: var(--shadow);
}

.hint {
  color: var(--rose);
  font-size: 1rem;
}

.nav-links {
  margin-top: 28px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
}

a.btn, button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--rose-dark);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, background 0.15s ease;
}

a.btn:hover, button.btn:hover {
  transform: translateY(-2px);
  background: var(--rose);
}

a.btn.secondary, button.btn.secondary {
  background: transparent;
  color: var(--rose-dark);
  border: 2px solid var(--gold);
  box-shadow: none;
}

button.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.field {
  margin-bottom: 18px;
  text-align: left;
}

.field label {
  display: block;
  font-size: 0.9rem;
  color: var(--rose);
  margin-bottom: 6px;
  font-weight: 600;
}

.field input[type="text"], .field textarea {
  width: 100%;
  border: 1px solid var(--gold-light);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}

.field textarea { resize: vertical; min-height: 70px; }

.capture-zone {
  border: 2px dashed var(--gold);
  border-radius: 16px;
  padding: 22px;
  text-align: center;
  margin-bottom: 20px;
  background: #fffaf2;
}

.capture-zone video, .capture-zone img {
  width: 100%;
  border-radius: 12px;
  margin-top: 14px;
  background: #000;
}

.capture-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 14px;
}

.status-msg {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.95rem;
  text-align: center;
}

.status-msg.ok { background: #e7f3ea; color: var(--ok); }
.status-msg.err { background: #fbe9e9; color: var(--err); }
.status-msg.info { background: #ffe6f2; color: var(--rose-dark); }

.hidden { display: none !important; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
  width: 100%;
  max-width: 1100px;
  margin-top: 10px;
}

.greeting-card {
  background: #fffdf9;
  border: 1px solid var(--gold-light);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.greeting-card .media-wrap {
  aspect-ratio: 4 / 5;
  background: #000;
}

.greeting-card iframe, .greeting-card img {
  width: 100%;
  height: 100%;
  border: none;
  object-fit: cover;
  display: block;
}

.greeting-card .meta {
  padding: 14px 16px;
}

.greeting-card .meta .from {
  font-weight: 700;
  color: var(--rose-dark);
  margin: 0 0 4px;
}

.greeting-card .meta .msg {
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
}

.greeting-card .meta .when {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: #9a8a8f;
}

.empty-state {
  text-align: center;
  color: var(--rose);
  margin-top: 40px;
  font-size: 1.05rem;
}

.progress-bar {
  width: 100%;
  height: 10px;
  background: var(--gold-light);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 14px;
}

.progress-bar > div {
  height: 100%;
  width: 0%;
  background: var(--rose-dark);
  transition: width 0.2s ease;
}