/* Shared foundations and dialogs for the garden invitation. */
:root {
  --bg: #f1f0ef;
  --soft: #e7eadd;
  --red: #465c3d;
  --red-dark: #30432c;
  --ink: #343d30;
  --muted: #73766b;
  --line: #d4d8c8;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Quicksand", system-ui, sans-serif;
  --script: "Great Vibes", cursive;
  --hand: "Dancing Script", cursive;
  --ease: cubic-bezier(.22, .61, .36, 1);
}
.wishes-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 500 15px/1.7 var(--sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; height: 100dvh; }
img { display: block; max-width: 100%; }
a { color: inherit; }

/* Chữ */
.script { font-family: var(--script); font-weight: 400; }
.bow { display: block; width: 72px; height: 54px; margin: 0 auto 12px; color: var(--red); }

.btn {
  display: inline-block;
  font: 600 12px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase;
  color: var(--red); background: transparent; text-decoration: none;
  border: 1px solid var(--red); border-radius: 999px; padding: 15px 34px; cursor: pointer;
  transition: background .35s var(--ease), color .35s var(--ease);
}
.btn:active, .btn:hover, .btn.solid { background: var(--red); color: #fff; }
.btn.solid:active, .btn.solid:hover { background: var(--red-dark); }

.lightbox {
  position: fixed; inset: 0; z-index: 60; background: rgba(255, 255, 255, .97);
  display: flex; align-items: center; justify-content: center; padding: 24px; overflow: hidden; overscroll-behavior: contain; touch-action: none;
  animation: fadeUp .4s var(--ease);
}
.lightbox[hidden] { display: none; }
.lightbox img { width: auto; height: auto; max-width: 100%; max-height: calc(100dvh - 100px); object-fit: contain; flex-shrink: 0; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; touch-action: none; transform-origin: center; cursor: grab; }
.photo-controls { position: absolute; z-index: 1; bottom: calc(16px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.photo-controls button { border: 0; border-radius: 50%; min-width: 44px; height: 44px; background: #38202be6; color: #fff; font: 600 20px/1 var(--sans); cursor: pointer; touch-action: none; }
.photo-controls button:nth-child(2) { font-size: 14px; }

.wishes-card { max-width: 400px; padding-top: 48px; }
.wishes-title { font: 600 24px/1.4 var(--sans); color: var(--red); }
.wishes-intro { font-size: 13px; color: var(--muted); margin: 8px 0 20px; }
#wishes-form { text-align: left; }
.wishes-field { display: block; font-size: 13px; font-weight: 600; margin-bottom: 16px; }
.wishes-field small { font-weight: 400; }
.wishes-field input, .wishes-field textarea { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: 400 16px/1.5 var(--sans); }
.wishes-field textarea { resize: vertical; min-height: 80px; }
.wishes-field input:focus, .wishes-field textarea:focus { border-color: var(--red); }
.wishes-attendance { border: 0; margin-bottom: 16px; font-size: 13px; }
.wishes-attendance legend { font-weight: 600; margin-bottom: 8px; }
.wishes-attendance label { display: flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; }
.wishes-attendance input { width: 18px; height: 18px; accent-color: var(--red); }
.wishes-absence[hidden] { display: none; }
.wishes-sad { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.wishes-sad span { font-size: 24px; vertical-align: middle; }
.wishes-status { font-size: 13px; margin-bottom: 14px; color: var(--muted); }
.wishes-status:empty { display: none; }
.wishes-status[data-state="error"] { color: var(--red); }
.wishes-status[data-state="success"] { color: #286044; }
.wishes-submit { width: 100%; line-height: 1.5; }
.wishes-submit:disabled { opacity: .6; cursor: wait; }
.wishes-card .modal-close { font: 24px/1 var(--sans); }

.modal {
  position: fixed; inset: 0; z-index: 65;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(30, 10, 10, .5); backdrop-filter: blur(3px);
  animation: fadeIn .3s var(--ease);
}
.modal[hidden] { display: none; }
.modal-card {
  position: relative; width: 100%; max-width: 360px; max-height: calc(100dvh - 32px); overflow-y: auto;
  background: #fff; border-radius: 20px; padding: 28px 22px 26px; text-align: center;
  animation: pop .4s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(.94); } }
.modal-close {
  position: absolute; top: 10px; right: 10px; width: 40px; height: 40px;
  display: grid; place-items: center; border: 0; border-radius: 50%;
  background: var(--soft); color: var(--red); cursor: pointer;
}
.modal .bow { width: 54px; height: 40px; margin-bottom: 0; }
.modal-title { font-size: 40px; line-height: 1.2; color: var(--red); margin-bottom: 16px; }

.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--soft); border-radius: 999px; padding: 4px; margin-bottom: 20px; }
.tab {
  font: 600 12px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase;
  color: var(--red); background: none; border: 0; border-radius: 999px; padding: 12px 8px; cursor: pointer;
  transition: background .25s var(--ease), color .25s var(--ease);
}
.tab[aria-selected="true"] { background: var(--red); color: #fff; }

.gift-panel[hidden] { display: none; }
.gift-panel .qr { width: 210px; height: 210px; margin: 0 auto 16px; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: #fff; }
.gift-panel .bank { font-size: 13px; color: var(--muted); }
.gift-panel .acc { font: 700 26px/1.4 var(--serif); letter-spacing: .06em; user-select: all; }
.gift-panel .holder { font-size: 12px; letter-spacing: .14em; margin-bottom: 18px; }
.gift-panel .btn { width: 100%; }
body.modal-open { overflow: hidden; }
/* Nút nhạc: đĩa than hình trái tim, góc trên bên phải */
.music {
  position: fixed; right: 16px; top: calc(16px + env(safe-area-inset-top)); z-index: 55;
  width: 52px; height: 52px; padding: 0; border: 0;
  background: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.music[hidden] { display: none; }
.music .disc {
  width: 100%; height: 100%; display: block; overflow: visible;
  filter: drop-shadow(0 3px 6px rgba(28, 28, 28, .25));
  transform-origin: 50% 45.8%; /* quay quanh tâm nhãn đĩa (24,22) */
  animation: spin 4s linear infinite paused;
  opacity: .55; transition: opacity .4s var(--ease);
}
.music.playing .disc { animation-play-state: running; opacity: 1; }
.music:active { transform: scale(.94); }
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; left: 50%; bottom: 80px; z-index: 70; transform: translate(-50%, 20px);
  background: var(--red); color: #fff; font-size: 13px; padding: 10px 18px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: .35s var(--ease); white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .lightbox, .modal, .modal-card, .music .disc { animation: none !important; transition: none !important; }
}
/* Floating wishes; layout and animation are defined in garden.css. */
.live-wishes { pointer-events: none; text-align: left; }
.live-wishes[hidden], .live-wishes-list[hidden] { display: none; }
body.locked .live-wishes, body.modal-open .live-wishes { visibility: hidden; }
.modal :focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.photo-counter { position: absolute; top: calc(16px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); padding: 5px 12px; border-radius: 20px; background: #38202b99; color: #fff; font: 500 13px/1.5 var(--sans); }
