:root {
  --blush: #f0e1d9;
  --rose: #7c2d3a;
  --rose-dark: #591f28;
  --gold: #a67c52;
  --ink: #2b211d;
  --muted: #8c7d72;
  --bg: #f7f1e6;
  --card-bg: #fffdf8;
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  font-weight: 400;
}

.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 15%, rgba(255,255,255,0.7), transparent 55%),
    var(--bg);
  opacity: 1;
  transition: opacity 0.6s ease;
}

.welcome-overlay.hide {
  opacity: 0;
  pointer-events: none;
}

.floating-hearts {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.floating-hearts span {
  position: absolute;
  bottom: -10%;
  color: rgba(124, 45, 58, 0.45);
  animation-name: float-up;
  animation-timing-function: ease-in;
  animation-iteration-count: infinite;
}

@keyframes float-up {
  0% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
  10% { opacity: 0.9; }
  100% { transform: translateY(-115vh) translateX(var(--drift, 20px)) rotate(30deg); opacity: 0; }
}

.welcome-box {
  position: relative;
  max-width: 440px;
  color: var(--ink);
}

.welcome-box > * {
  opacity: 0;
  animation: welcome-in 0.8s ease forwards;
}

.welcome-heart {
  display: inline-block;
  font-size: 1.8rem;
  margin-bottom: 6px;
  color: var(--rose);
  animation: heartbeat 1.6s ease-in-out infinite, welcome-in 0.8s ease forwards;
  animation-delay: 0s, 0s;
}

.welcome-box .eyebrow { animation-delay: 0.15s; }
.welcome-box h2 { animation-delay: 0.3s; }
.welcome-names { animation-delay: 0.45s; }
.welcome-msg { animation-delay: 0.6s; }
.welcome-box .btn { animation-delay: 0.85s; }

@keyframes welcome-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.25); }
  30% { transform: scale(1); }
  45% { transform: scale(1.15); }
  60% { transform: scale(1); }
}

.welcome-box h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.4rem, 8vw, 3.2rem);
  margin: 4px 0 6px;
  font-weight: 500;
  color: var(--ink);
}

.welcome-names {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(1.6rem, 5vw, 2.1rem);
  margin: 0 0 16px;
  color: var(--rose);
}

.welcome-names .amp {
  color: var(--ink);
  font-style: italic;
}

.welcome-msg {
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 26px;
  color: var(--ink);
  opacity: 0.85;
}

.welcome-box .btn {
  width: auto;
  padding: 12px 36px;
  animation: welcome-in 0.8s ease forwards, glow-pulse 2.4s ease-in-out infinite 1.8s;
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124, 45, 58, 0.3); }
  50% { box-shadow: 0 0 0 10px rgba(124, 45, 58, 0); }
}

body.no-scroll {
  overflow: hidden;
}

.banner {
  min-height: 46vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.7), transparent 55%),
    var(--bg);
  color: var(--ink);
  padding: 40px 20px;
}

.banner-overlay { max-width: 600px; }

.eyebrow {
  font-family: 'Cormorant Garamond', serif;
  text-transform: uppercase;
  letter-spacing: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--rose);
  margin: 0 0 8px;
}

.banner h1 {
  font-family: 'Great Vibes', 'Cormorant Garamond', cursive;
  font-size: clamp(3.2rem, 11vw, 6rem);
  margin: 0;
  font-weight: normal;
  line-height: 1.15;
  color: var(--ink);
}

.amp {
  color: var(--rose);
}

.hero-photo-wrap {
  width: 130px;
  height: 130px;
  margin: 0 auto 18px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--rose);
  box-shadow: 0 8px 24px rgba(43, 33, 29, 0.12);
  background: var(--blush);
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-photo-wrap.no-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
}

.hero-photo-wrap[hidden] {
  display: none;
}

.hero-photo-wrap.no-photo::after {
  content: '\1F495';
  color: var(--rose);
}

.date {
  font-family: 'Cormorant Garamond', serif;
  margin-top: 12px;
  font-size: 1.2rem;
  font-style: italic;
  color: var(--muted);
}

.countdown {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
  flex-wrap: wrap;
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 68px;
  padding: 14px 8px;
  background: var(--blush);
  border: 1.5px solid var(--rose);
  border-radius: 18px;
}

.countdown-value {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 5vw, 2.1rem);
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.countdown-label {
  margin-top: 6px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--rose);
}

.countdown.arrived .countdown-unit {
  background: #f3e6d6;
  border-color: var(--gold);
}

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 8px 0;
}

.divider-line {
  flex: 1;
  max-width: 220px;
  height: 1px;
  background: var(--rose);
  opacity: 0.5;
}

.divider-ornament {
  color: var(--rose);
  font-size: 1.1rem;
  line-height: 1;
}

main {
  max-width: 720px;
  margin: -30px auto 0;
  padding: 0 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.couple-photo-section {
  display: flex;
  justify-content: center;
  margin-top: 26px;
}

.couple-photo-section[hidden] {
  display: none;
}

.couple-photo-wrap {
  width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: 20px;
  overflow: hidden;
  border: 3px solid var(--rose);
  box-shadow: 0 12px 32px rgba(43, 33, 29, 0.18);
}

.couple-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(58, 46, 44, 0.08);
  padding: 24px;
}

.card h2 {
  margin-top: 0;
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem;
  font-weight: 500;
  color: var(--ink);
}

.hint {
  color: var(--muted);
  font-size: 0.95rem;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 2px dashed var(--rose);
  border-radius: var(--radius);
  padding: 32px 16px;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s, border-color 0.2s;
}

.dropzone:hover,
.dropzone.dragover {
  background: var(--blush);
  border-color: var(--gold);
}

.dropzone-icon { font-size: 2.2rem; }

.dropzone-text {
  color: var(--muted);
  font-size: 0.95rem;
}

.preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.preview-list img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
}

.name-label {
  display: block;
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--muted);
}

.name-label span {
  font-style: italic;
}

.name-input {
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid var(--blush);
  border-radius: 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--bg);
}

.name-input:focus {
  outline: none;
  border-color: var(--rose);
}

.btn {
  width: 100%;
  margin-top: 18px;
  padding: 14px;
  border: none;
  border-radius: 999px;
  background: var(--rose);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.btn:disabled {
  background: #d9cac7;
  cursor: not-allowed;
}

.btn:not(:disabled):hover {
  background: var(--rose-dark);
}

.status-msg {
  text-align: center;
  min-height: 1.2em;
  margin: 10px 0 0;
  font-size: 0.9rem;
  color: var(--rose-dark);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}

.gallery-item {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 10px;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

.gallery-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 4px 8px 5px;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 0.85rem;
  color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0));
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.gallery-item.new-photo {
  animation: pop-in 0.4s ease;
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.maze-start-wrap {
  text-align: center;
}

.maze-start-wrap .btn {
  width: auto;
  padding: 12px 40px;
}

.maze-game {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 18px;
}

.maze-game[hidden] {
  display: none;
}

.maze-container {
  display: grid;
  position: relative;
  background: var(--bg);
  border: 3px solid var(--rose-dark);
  border-radius: 8px;
  outline: none;
}

.maze-container:focus-visible {
  box-shadow: 0 0 0 3px rgba(201, 138, 131, 0.4);
}

.maze-cell {
  box-sizing: border-box;
}

.maze-cell.wall-top { border-top: 3px solid var(--rose-dark); }
.maze-cell.wall-right { border-right: 3px solid var(--rose-dark); }
.maze-cell.wall-bottom { border-bottom: 3px solid var(--rose-dark); }
.maze-cell.wall-left { border-left: 3px solid var(--rose-dark); }

.maze-player,
.maze-goal {
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  pointer-events: none;
}

.maze-goal {
  z-index: 1;
}

.maze-player {
  z-index: 2;
  transition: transform 0.12s linear;
}

.maze-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
}

.maze-controls-row {
  display: flex;
  gap: 6px;
}

.maze-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--rose);
  background: #fff;
  color: var(--rose-dark);
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.15s;
}

.maze-btn:hover,
.maze-btn:active {
  background: var(--blush);
}

.maze-win {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 16px;
  background: rgba(255, 250, 247, 0.95);
  border-radius: var(--radius);
  z-index: 5;
  animation: welcome-in 0.5s ease;
}

.maze-win[hidden] {
  display: none;
}

.maze-win-emoji {
  font-size: 2.6rem;
  margin: 0;
  animation: heartbeat 1.4s ease-in-out infinite;
}

.maze-win-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  color: var(--rose-dark);
  margin: 0;
}

.maze-win .btn {
  width: auto;
  padding: 10px 30px;
}

footer {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.1rem;
}
