:root {
  --vanilla: #fff5ef;
  --blush: #ffe3d9;
  --linen: #fffdfa;
  --espresso: #3c2b25;
  --taupe: #8d7268;
  --rosewood: #d26d63;
  --gold: #e2ad5f;
  --line: #f0d6cc;
  --danger: #bf4a64;
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow-soft: 0 14px 30px rgba(210, 109, 99, 0.16);
  --paper: #fffdfc;
  --paper-warm: #fff6f2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Source Sans 3", sans-serif;
  color: var(--espresso);
  background:
    radial-gradient(circle at 8% -10%, #ffd2ba 0, transparent 35%),
    radial-gradient(circle at 95% 12%, #ffd4dd 0, transparent 28%),
    var(--vanilla);
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

body::before {
  opacity: 0.2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Ctext x='22' y='52' font-size='22' fill='%23d26d63' fill-opacity='0.55'%3E%E2%9D%A4%3C/text%3E%3Ctext x='120' y='72' font-size='20' fill='%23e2ad5f' fill-opacity='0.58'%3E%E2%9C%BF%3C/text%3E%3Ctext x='68' y='140' font-size='18' fill='%23bf4a64' fill-opacity='0.45'%3E%E2%9D%80%3C/text%3E%3Ctext x='156' y='170' font-size='17' fill='%23d26d63' fill-opacity='0.4'%3E%E2%9D%A4%3C/text%3E%3Ctext x='30' y='198' font-size='16' fill='%23e2ad5f' fill-opacity='0.45'%3E%E2%9C%BF%3C/text%3E%3C/svg%3E");
  background-size: 220px 220px;
  background-repeat: repeat;
}

body::after {
  opacity: 0.14;
  background-image:
    linear-gradient(45deg, rgba(210, 109, 99, 0.12) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(210, 109, 99, 0.12) 25%, transparent 25%);
  background-size: 28px 28px;
  background-position:
    0 0,
    14px 14px;
}

.announcement-bar {
  background: linear-gradient(90deg, #ee7f5f, #f3b24d);
  color: #fff;
  text-align: center;
  padding: 0.55rem 1rem;
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.8rem 1.25rem 1.8rem;
}

.hero-inner {
  background: linear-gradient(135deg, rgba(255, 252, 248, 0.96), rgba(255, 230, 219, 0.96));
  border: 1px solid rgba(210, 109, 99, 0.26);
  border-radius: 32px;
  box-shadow: var(--shadow-soft);
  text-align: center;
  padding: 2.1rem 1.4rem;
  position: relative;
  overflow: hidden;
}

.hero-inner::before {
  content: "";
  position: absolute;
  left: 18px;
  bottom: 16px;
  width: 160px;
  height: 160px;
  opacity: 0.7;
  background-image: url("https://gallery.yopriceville.com/var/resizes/Free-Clipart-Pictures/Birds-PNG/White_Dove_Transparent_PNG_Clipart.png?m=1629829990");
  background-size: contain;
  background-repeat: no-repeat;
}

.hero-inner::after {
  content: "";
  position: absolute;
  right: -10px;
  top: -10px;
  width: 140px;
  height: 140px;
  opacity: 0.32;
  background-image: url("https://gallery.yopriceville.com/var/resizes/Free-Clipart-Pictures/Birds-PNG/White_Dove_Transparent_PNG_Clipart.png?m=1629829990");
  background-size: contain;
  background-repeat: no-repeat;
  transform: scaleX(-1);
}

.hero-inner h1::after {
  content: "  ❤  ✿";
  color: rgba(210, 109, 99, 0.75);
  font-size: 0.55em;
  letter-spacing: 0.2em;
  vertical-align: middle;
}

.badge {
  display: inline-block;
  margin: 0;
  padding: 0.42rem 0.95rem;
  border: 1px solid rgba(210, 109, 99, 0.42);
  border-radius: 999px;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rosewood);
  background: #fff;
}

h1,
h2,
h3,
h4 {
  font-family: "Playfair Display", serif;
  color: var(--rosewood);
}

h1 {
  margin: 0.8rem 0 0.65rem;
  font-size: clamp(2rem, 5.5vw, 3.3rem);
  line-height: 1.06;
}

.hero p {
  max-width: 680px;
  margin: 0 auto;
  font-size: 1.08rem;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem 3.5rem;
}

.card {
  background: linear-gradient(180deg, var(--linen), var(--paper-warm));
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "❤ ✿ ❀";
  position: absolute;
  top: 0.45rem;
  right: 0.7rem;
  font-size: 0.78rem;
  letter-spacing: 0.2rem;
  color: rgba(210, 109, 99, 0.35);
}

.intro {
  padding: 1.3rem 1.35rem;
  margin-bottom: 1.4rem;
}

.intro ol {
  margin: 0.5rem 0 0;
  padding-left: 1.15rem;
}

.section-title {
  margin: 0 0 0.9rem;
  font-size: 1.7rem;
}

.status {
  margin: 0 0 1rem;
  padding: 0.82rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(226, 173, 95, 0.2);
  border: 1px solid rgba(226, 173, 95, 0.38);
  color: #865c2d;
}

.status:empty {
  display: none;
}

.status.error {
  background: rgba(191, 74, 100, 0.14);
  border-color: rgba(191, 74, 100, 0.32);
  color: #8f334a;
}

.gift-grid,
.admin-gift-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
}

.gift {
  background: var(--paper);
  border-radius: var(--radius-md);
  padding: 1rem;
  border: 1px solid var(--line);
  box-shadow: 0 10px 22px rgba(210, 109, 99, 0.14);
  position: relative;
  display: flex;
  flex-direction: column;
}

.gift::before {
  content: "";
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffd27e, #ef7a62);
  opacity: 0.7;
  z-index: 3;
}

.gift::after {
  content: "";
  position: absolute;
  right: 0.7rem;
  bottom: 0.65rem;
  width: 24px;
  height: 24px;
  opacity: 0.58;
  background-image: url("https://gallery.yopriceville.com/var/resizes/Free-Clipart-Pictures/Birds-PNG/White_Dove_Transparent_PNG_Clipart.png?m=1629829990");
  background-size: contain;
  background-repeat: no-repeat;
}

.gift h3::after {
  content: "  ❤";
  color: rgba(191, 74, 100, 0.75);
  font-size: 0.65em;
}

.section-title::after {
  content: "  ✿  ❀";
  color: rgba(226, 173, 95, 0.9);
  font-size: 0.7em;
  letter-spacing: 0.1em;
}

footer p:first-child::before,
footer p:first-child::after {
  content: "✿";
  color: rgba(210, 109, 99, 0.75);
  margin: 0 0.45rem;
}

.gift-photo-strip {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  margin-bottom: 0.75rem;
}

.gift-carousel {
  position: relative;
}

.gift-photo {
  width: 100%;
  min-width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #fff7f1;
  padding: 0.2rem;
  border-radius: 12px;
  scroll-snap-align: start;
  margin-bottom: 0;
  position: relative;
  z-index: 1;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  font-size: 1.1rem;
  background: rgba(210, 109, 99, 0.82);
  z-index: 5;
}

.carousel-btn.prev {
  left: 0.45rem;
}

.carousel-btn.next {
  right: 0.45rem;
}

.gift h3,
.admin-gift-item h4 {
  margin: 0 0 0.45rem;
  font-size: 1.28rem;
}

.price {
  margin: 0 0 0.65rem;
  color: var(--taupe);
  font-weight: 600;
}

.gift p:not(.price):not(.small-note) {
  text-align: justify;
}

.gift button[data-gift-id] {
  margin-top: auto;
  align-self: center;
}

button {
  border: none;
  border-radius: 999px;
  background: linear-gradient(90deg, #ef7a62, #f3ac57);
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.68rem 1.06rem;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
}

.carousel-btn:hover {
  transform: translateY(-50%);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button.secondary {
  background: #f8e5de;
  color: var(--espresso);
}

button.danger {
  background: linear-gradient(90deg, #bf4a64, #d76c86);
}

.modal {
  width: min(580px, calc(100% - 2rem));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0;
  box-shadow: var(--shadow-soft);
  background: var(--paper);
}

.modal::backdrop {
  background: rgba(93, 48, 56, 0.4);
}

.thanks-modal {
  max-width: 460px;
}

.thanks-content {
  text-align: center;
  gap: 0.6rem;
}

.thanks-image {
  width: min(220px, 70%);
  margin: 0 auto 0.2rem;
  display: block;
}

.image-modal {
  max-width: 900px;
  width: min(92vw, 900px);
}

.image-modal-content {
  display: grid;
  gap: 0.8rem;
  justify-items: center;
}

.image-modal-preview {
  width: 100%;
  max-height: 76vh;
  object-fit: contain;
  border-radius: 14px;
  background: #fff7f1;
  padding: 0.35rem;
}

.modal-form {
  display: grid;
  gap: 0.8rem;
  padding: 1.2rem;
}

.selected-gift {
  margin: 0;
  color: var(--taupe);
}

label {
  display: grid;
  gap: 0.3rem;
  font-weight: 600;
}

input,
textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #daccc0;
  border-radius: 12px;
  font: inherit;
  background: var(--paper);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #ef9a72;
  box-shadow: 0 0 0 3px rgba(239, 154, 114, 0.25);
}

.modal-actions,
.inline-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.modal-actions {
  justify-content: flex-end;
}

.small-note {
  margin: 0;
  font-size: 0.88rem;
  color: var(--taupe);
}

footer {
  text-align: center;
  padding: 1.25rem;
  color: #916c61;
}

footer a {
  color: var(--rosewood);
  font-weight: 700;
}

.hidden {
  display: none;
}

.auth-card {
  max-width: 560px;
  margin: 0 auto 1.4rem;
  padding: 1.2rem;
}

.auth-form,
.gift-form {
  display: grid;
  gap: 0.8rem;
}

.admin-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.gift-admin-card,
.table-card {
  margin-bottom: 1rem;
  padding: 1rem;
}

.existing-photos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem;
}

.existing-photo-item {
  background: #fff1ea;
  border: 1px solid #f0d9cf;
  border-radius: 12px;
  padding: 0.5rem;
}

.existing-photo-item img,
.admin-gift-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff7f1;
  padding: 0.2rem;
  border-radius: 10px;
  margin-bottom: 0.45rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.summary-card {
  padding: 1rem;
}

.summary-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.summary-card p {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  text-align: left;
  padding: 0.65rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--rosewood);
  background: #ffece1;
}

@media (max-width: 560px) {
  .hero {
    padding-top: 2rem;
  }

  .hero-inner {
    border-radius: 20px;
    padding: 1.4rem 1rem;
  }

  .modal-actions,
  .inline-actions,
  .admin-head {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-actions button,
  .inline-actions button,
  .admin-head button {
    width: 100%;
  }
}
