:root {
  --burgundy: #67130c;
  --burgundy-deep: #470c07;
  --burgundy-soft: #8a1f16;
  --espresso: #151110;
  --camera-body: #1f1917;
  --camera-leather: #261e1c;
  --champagne: #e5cfb0;
  --champagne-muted: #bba282;
  --ivory: #faf5ee;
  --ivory-card: #f3ebe0;
  --quartz-amber: #ff922b;
  --ink-dark: #231815;
  --ink-muted: #6c5750;
  --success: #3ca374;
  --danger: #d94c43;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--espresso);
  color: var(--ivory);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100dvh;
  overflow-x: hidden;
}

.serif-display {
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
}

.mono-counter {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}

/* App Shell */
.app-shell {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: 84px;
}

.app-shell.wide-mode {
  max-width: 1120px;
  padding-bottom: 40px;
}

/* Top Brand Header */
.wedding-header {
  padding: 16px 18px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-monogram-badge {
  background: var(--ivory);
  border: 1px solid rgba(229, 207, 176, 0.45);
  border-radius: 10px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.brand-monogram-badge img {
  height: 26px;
  width: auto;
  display: block;
}

.brand-titles h1 {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--champagne);
  line-height: 1.15;
}

.brand-titles p {
  margin: 2px 0 0;
  font-size: 0.73rem;
  color: rgba(250, 245, 238, 0.65);
  letter-spacing: 0.06em;
}

.guest-pill-btn {
  background: rgba(250, 245, 238, 0.08);
  border: 1px solid rgba(229, 207, 176, 0.26);
  color: var(--champagne);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 165px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.2s, border-color 0.2s;
}

.guest-pill-btn:hover {
  background: rgba(250, 245, 238, 0.14);
  border-color: var(--champagne);
}

/* In-App Browser (Zalo/Messenger) Banner */
.inapp-banner {
  margin: 4px 16px 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(103, 19, 12, 0.9), rgba(65, 11, 7, 0.95));
  border: 1px solid rgba(229, 207, 176, 0.35);
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--ivory);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Upload Queue Floating Pill */
.queue-toast {
  margin: 2px 16px 8px;
  padding: 8px 13px;
  border-radius: 10px;
  background: rgba(60, 163, 116, 0.15);
  border: 1px solid rgba(60, 163, 116, 0.4);
  color: #a8f0cd;
  font-size: 0.76rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Disposable Camera Body */
.camera-chassis {
  margin: 4px 14px 12px;
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.04) 0%, transparent 50%),
    repeating-radial-gradient(circle at 0 0, rgba(255,255,255,0.014) 0, rgba(255,255,255,0.014) 1px, transparent 1px, transparent 4px),
    linear-gradient(180deg, #28201d 0%, #191412 100%);
  border: 1.5px solid rgba(229, 207, 176, 0.22);
  border-radius: 26px;
  padding: 14px;
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
}

/* Top Camera Mechanical Bar */
.camera-top-deck {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 4px;
}

.ready-lamp {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(250, 245, 238, 0.72);
}

.lamp-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff7b29;
  box-shadow: 0 0 10px #ff7b29;
}

.exposure-window {
  background: #0d0a09;
  border: 1.5px solid rgba(229, 207, 176, 0.34);
  border-radius: 8px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.9);
}

.exposure-window .exp-num {
  color: var(--quartz-amber);
  font-weight: 700;
  font-size: 0.95rem;
  text-shadow: 0 0 8px rgba(255, 146, 43, 0.55);
}

.exposure-window .exp-label {
  font-size: 0.64rem;
  color: rgba(250, 245, 238, 0.55);
  letter-spacing: 0.08em;
}

/* Viewfinder Frame */
.viewfinder-bezel {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 54dvh;
  background: #0b0908;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid rgba(229, 207, 176, 0.25);
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.85);
}

.viewfinder-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 0.22s ease;
}

.viewfinder-video.mirrored {
  transform: scaleX(-1);
}

/* 35mm Viewfinder Guides */
.viewfinder-guides {
  position: absolute;
  inset: 14px;
  pointer-events: none;
  border: 1px solid rgba(250, 245, 238, 0.2);
  border-radius: 10px;
}

.viewfinder-guides::before,
.viewfinder-guides::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-color: rgba(250, 245, 238, 0.35);
}

.viewfinder-guides::before {
  width: 22px;
  height: 1px;
  background: rgba(250, 245, 238, 0.35);
}

.viewfinder-guides::after {
  width: 1px;
  height: 22px;
  background: rgba(250, 245, 238, 0.35);
}

.vf-date-preview {
  position: absolute;
  right: 16px;
  bottom: 14px;
  font-size: 0.86rem;
  font-weight: 700;
  color: rgba(255, 146, 43, 0.9);
  text-shadow: 0 0 8px rgba(255, 94, 0, 0.8);
  pointer-events: none;
  letter-spacing: 0.06em;
}

.vf-watermark-tag {
  position: absolute;
  left: 14px;
  top: 12px;
  background: rgba(21, 17, 16, 0.58);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(229, 207, 176, 0.25);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.68rem;
  color: var(--champagne);
  letter-spacing: 0.05em;
  pointer-events: none;
}

/* Flash Burst Overlay */
.shutter-flash {
  position: absolute;
  inset: 0;
  background: #fff9f0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.06s ease-out;
  z-index: 15;
}

.shutter-flash.active {
  opacity: 0.96;
}

/* Fallback / Permission State inside Viewfinder */
.vf-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: radial-gradient(circle at center, #2b1815 0%, #110d0c 100%);
  z-index: 8;
}

.vf-fallback img.fallback-logo {
  height: 48px;
  margin-bottom: 14px;
  opacity: 0.92;
}

.vf-fallback h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  color: var(--champagne);
}

.vf-fallback p {
  margin: 0 0 18px;
  font-size: 0.83rem;
  color: rgba(250, 245, 238, 0.72);
  line-height: 1.45;
}

/* Film Stock Selector Strip */
.film-strip-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  padding: 12px 2px 6px;
  scrollbar-width: none;
}

.film-strip-bar::-webkit-scrollbar {
  display: none;
}

.film-chip {
  flex: 0 0 auto;
  background: rgba(250, 245, 238, 0.06);
  border: 1px solid rgba(229, 207, 176, 0.18);
  color: rgba(250, 245, 238, 0.78);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
}

.film-chip .film-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.film-chip.active {
  background: var(--burgundy);
  border-color: var(--champagne);
  color: var(--ivory);
  box-shadow: 0 4px 12px rgba(103, 19, 12, 0.55);
}

/* Camera Controls Row */
.camera-controls-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-top: 10px;
  padding: 4px 4px 2px;
}

.cam-aux-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cam-aux-group.right {
  justify-content: flex-end;
}

.cam-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(250, 245, 238, 0.08);
  border: 1px solid rgba(229, 207, 176, 0.24);
  color: var(--ivory);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.78rem;
  transition: all 0.18s;
}

.cam-icon-btn.active {
  background: rgba(255, 146, 43, 0.22);
  border-color: var(--quartz-amber);
  color: var(--quartz-amber);
}

.cam-icon-btn:active {
  transform: scale(0.93);
}

/* Tactile Burgundy & Brass Shutter Button */
.shutter-outer {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  padding: 5px;
  background: linear-gradient(145deg, var(--champagne), #8f7250);
  border: none;
  cursor: pointer;
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.6),
    0 0 0 3px rgba(229, 207, 176, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease;
}

.shutter-outer:active:not(:disabled) {
  transform: scale(0.92);
}

.shutter-outer:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.shutter-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #8f1d14 0%, var(--burgundy) 60%, #430a06 100%);
  border: 2px solid rgba(250, 245, 238, 0.35);
}

/* Secondary Action Strip below camera */
.camera-subactions {
  margin: 0 16px 12px;
  display: flex;
  gap: 10px;
}

.subaction-btn {
  flex: 1;
  background: rgba(250, 245, 238, 0.07);
  border: 1px solid rgba(229, 207, 176, 0.22);
  color: var(--ivory);
  border-radius: 14px;
  padding: 11px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s, border-color 0.2s;
}

.subaction-btn:hover {
  background: rgba(250, 245, 238, 0.12);
  border-color: var(--champagne);
}

.subaction-btn.primary-burgundy {
  background: linear-gradient(135deg, var(--burgundy-soft), var(--burgundy));
  border-color: rgba(229, 207, 176, 0.45);
}

/* Locked POV Developing Film Card */
.pov-envelope-card {
  margin: 8px 16px 18px;
  background: var(--ivory);
  color: var(--ink-dark);
  border-radius: 22px;
  padding: 24px 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  border: 2px solid var(--burgundy);
  text-align: center;
  position: relative;
}

.pov-envelope-card .envelope-logo {
  height: 44px;
  width: auto;
  margin-bottom: 10px;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 16px 0;
}

.cd-box {
  background: var(--espresso);
  color: var(--champagne);
  border-radius: 12px;
  padding: 10px 6px;
}

.cd-box .cd-val {
  font-size: 1.35rem;
  font-weight: 700;
  display: block;
}

.cd-box .cd-lbl {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.72;
}

/* My Unrevealed Film Strip */
.film-negatives-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin: 12px 16px;
}

.negative-frame {
  background: #201917;
  border: 1px dashed rgba(229, 207, 176, 0.32);
  border-radius: 12px;
  padding: 12px;
  text-align: left;
}

/* Revealed Polaroid / Editorial Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 8px 16px 24px;
}

@media (min-width: 768px) {
  .app-shell.wide-mode .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
  }
}

.polaroid-card {
  background: var(--ivory);
  color: var(--ink-dark);
  border-radius: 14px;
  padding: 8px 8px 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.38);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.18s ease;
}

.polaroid-card:hover {
  transform: translateY(-2px);
}

.polaroid-img-wrap {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 9px;
  overflow: hidden;
  background: #241d1b;
  position: relative;
}

.polaroid-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.polaroid-meta {
  padding: 8px 4px 0;
}

.polaroid-author {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--burgundy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.polaroid-wish {
  font-size: 0.74rem;
  color: var(--ink-muted);
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

/* Standalone Wish Card in Gallery / Guestbook */
.wish-note-card {
  background: linear-gradient(160deg, #faf5ee 0%, #f1e6d8 100%);
  color: var(--ink-dark);
  border-radius: 16px;
  padding: 16px;
  border-left: 4px solid var(--burgundy);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: rgba(21, 17, 16, 0.92);
  backdrop-filter: blur(14px);
  border-top: 1px solid rgba(229, 207, 176, 0.18);
  display: flex;
  justify-content: center;
}

.bottom-nav-inner {
  width: 100%;
  max-width: 520px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px));
}

.nav-tab {
  background: none;
  border: none;
  color: rgba(250, 245, 238, 0.56);
  padding: 7px 4px;
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border-radius: 12px;
  transition: color 0.2s, background 0.2s;
}

.nav-tab.active {
  color: var(--champagne);
  background: rgba(103, 19, 12, 0.38);
}

/* Modal / Bottom Sheet (Post-Capture Wish & Guest Name) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 7, 6, 0.78);
  backdrop-filter: blur(6px);
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
}

@media (min-width: 640px) {
  .modal-backdrop {
    align-items: center;
  }
}

.sheet-card {
  width: 100%;
  max-width: 460px;
  background: var(--ivory);
  color: var(--ink-dark);
  border-radius: 24px;
  padding: 22px 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  border: 2px solid var(--burgundy);
  max-height: 90dvh;
  overflow-y: auto;
}

.sheet-card h3 {
  margin: 0 0 6px;
  color: var(--burgundy);
  font-size: 1.35rem;
}

.form-field {
  margin-bottom: 14px;
  text-align: left;
}

.form-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-dark);
  margin-bottom: 5px;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  border: 1.5px solid rgba(103, 19, 12, 0.28);
  background: #ffffff;
  color: var(--ink-dark);
  border-radius: 12px;
  padding: 10px 13px;
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--burgundy);
  box-shadow: 0 0 0 3px rgba(103, 19, 12, 0.12);
}

.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.btn-burgundy {
  background: var(--burgundy);
  color: var(--ivory);
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  flex: 1;
}

.btn-burgundy:hover {
  background: var(--burgundy-soft);
}

.btn-outline-dark {
  background: transparent;
  color: var(--ink-dark);
  border: 1.5px solid rgba(35, 24, 21, 0.28);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

/* Admin Dashboard Panel */
.admin-panel {
  padding: 16px;
}

.admin-card {
  background: #211a18;
  border: 1px solid rgba(229, 207, 176, 0.2);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 16px;
}

.stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-tile {
  background: rgba(250, 245, 238, 0.05);
  border: 1px solid rgba(229, 207, 176, 0.16);
  border-radius: 14px;
  padding: 14px;
}

.stat-tile .num {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--champagne);
}

.stat-tile .lbl {
  font-size: 0.75rem;
  color: rgba(250, 245, 238, 0.65);
}

.admin-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.admin-photo-item {
  background: #181311;
  border: 1px solid rgba(229, 207, 176, 0.18);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.admin-photo-item.hidden-item {
  opacity: 0.5;
}

.hidden {
  display: none !important;
}
