:root {
  --cream: #fdf6ee;
  --blush: #f7d9d9;
  --blush-deep: #eebcc0;
  --sage: #cdd9c4;
  --gold: #c9a35a;
  --gold-light: #e8cf9c;
  --gold-deep: #8a6a2f;
  --ink: #5a4a3f;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-size: 1.05rem;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.5), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(255, 255, 255, 0.4), transparent 45%),
    linear-gradient(160deg, var(--cream) 0%, var(--blush) 55%, var(--sage) 100%);
  background-size: 200% 200%, 200% 200%, 200% 200%;
  animation: bg-drift 18s ease-in-out infinite;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

@keyframes bg-drift {
  0% { background-position: 0% 0%, 0% 0%, 0% 0%; }
  50% { background-position: 100% 100%, 100% 0%, 100% 100%; }
  100% { background-position: 0% 0%, 0% 0%, 0% 0%; }
}

/* ---------- Loading splash / envelope reveal ---------- */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--cream), var(--blush));
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.splash-screen.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-loading,
.splash-envelope {
  text-align: center;
  color: var(--gold-deep);
}

.splash-envelope {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  cursor: pointer;
  animation: fade-in 0.7s ease forwards;
}

.splash-screen.envelope-mode .splash-loading {
  display: none;
}

.splash-screen.envelope-mode .splash-envelope {
  display: flex;
}

.splash-icon {
  font-size: 2.4rem;
  display: block;
  margin-bottom: 0.6rem;
  animation: gentle-bob 2.2s ease-in-out infinite;
}

.splash-loading p,
.splash-envelope p {
  letter-spacing: 0.1em;
  font-size: 0.85rem;
  text-transform: uppercase;
  font-family: 'Playfair Display', serif;
}

.envelope-seal {
  position: relative;
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  background: radial-gradient(circle, #fff7e8, var(--gold-light));
  box-shadow: 0 8px 22px rgba(201, 163, 90, 0.4), inset 0 0 0 1px rgba(201, 163, 90, 0.5);
}

.envelope-seal::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid rgba(201, 163, 90, 0.55);
  animation: ring-pulse 2.2s ease-in-out infinite;
}

.envelope-cta {
  font-size: 0.95rem !important;
  letter-spacing: 0.05em !important;
  text-transform: none !important;
  font-style: italic;
}

.credit-text {
  position: fixed;
  bottom: max(1.2rem, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 101;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  opacity: 0.85;
  padding: 0.4rem 0.7rem;
  transition: opacity 0.3s ease, transform 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

.credit-text:hover,
.credit-text:focus-visible {
  opacity: 1;
  transform: translateX(-50%) scale(1.04);
}

.credit-pulse {
  display: inline-block;
  animation: credit-pulse 1.4s ease-in-out infinite;
}

@keyframes credit-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

.credit-name {
  font-weight: 700;
  color: var(--gold-deep);
  text-decoration: underline;
  text-decoration-color: rgba(138, 106, 47, 0.45);
  text-underline-offset: 2px;
}

/* ---------- Heart shower ---------- */
.heart-piece {
  position: fixed;
  top: -8%;
  opacity: 0.95;
  animation: heart-fall linear forwards;
  z-index: 70;
  pointer-events: none;
}

@keyframes heart-fall {
  0% { transform: translateY(0) rotate(0deg) scale(0.8); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translateY(115vh) rotate(360deg) scale(1.1); opacity: 0.85; }
}

/* ---------- Ornamental page frame ---------- */
.page-frame {
  position: fixed;
  inset: 14px;
  border: 1px solid rgba(201, 163, 90, 0.55);
  border-radius: 14px;
  pointer-events: none;
  z-index: 2;
}

.page-frame::before {
  content: '';
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(201, 163, 90, 0.3);
  border-radius: 10px;
}

.corner {
  position: absolute;
  width: 34px;
  height: 34px;
  z-index: 3;
  pointer-events: none;
}

.corner::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-color: var(--gold);
}

.corner-tl { top: 14px; left: 14px; }
.corner-tl::before { border-top: 2px solid var(--gold); border-left: 2px solid var(--gold); border-radius: 10px 0 0 0; }

.corner-tr { top: 14px; right: 14px; }
.corner-tr::before { border-top: 2px solid var(--gold); border-right: 2px solid var(--gold); border-radius: 0 10px 0 0; }

.corner-bl { bottom: 14px; left: 14px; }
.corner-bl::before { border-bottom: 2px solid var(--gold); border-left: 2px solid var(--gold); border-radius: 0 0 0 10px; }

.corner-br { bottom: 14px; right: 14px; }
.corner-br::before { border-bottom: 2px solid var(--gold); border-right: 2px solid var(--gold); border-radius: 0 0 10px 0; }

@media (max-width: 480px) {
  .page-frame { inset: 8px; border-width: 0.5px; }
  .page-frame::before { inset: 5px; }
  .corner { width: 22px; height: 22px; }
  .corner-tl, .corner-tr { top: 8px; }
  .corner-bl, .corner-br { bottom: 8px; }
  .corner-tl, .corner-bl { left: 8px; }
  .corner-tr, .corner-br { right: 8px; }
  .corner-tl::before { border-width: 1px; border-radius: 7px 0 0 0; }
  .corner-tr::before { border-width: 1px; border-radius: 0 7px 0 0; }
  .corner-bl::before { border-width: 1px; border-radius: 0 0 0 7px; }
  .corner-br::before { border-width: 1px; border-radius: 0 0 7px 0; }
}

/* ---------- Floating decorative particles ---------- */
.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.particle {
  position: absolute;
  bottom: -10%;
  font-size: 1.6rem;
  opacity: 0.55;
  animation-name: float-up;
  animation-timing-function: ease-in;
  animation-iteration-count: infinite;
  filter: drop-shadow(0 0 6px rgba(201, 163, 90, 0.35));
}

@keyframes float-up {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% { opacity: 0.6; }
  50% {
    transform: translateY(-55vh) translateX(20px) rotate(180deg);
  }
  90% { opacity: 0.5; }
  100% {
    transform: translateY(-110vh) translateX(-10px) rotate(360deg);
    opacity: 0;
  }
}

/* ---------- Layout ---------- */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6vh 5vw;
  padding-top: max(6vh, env(safe-area-inset-top));
  padding-bottom: max(6vh, env(safe-area-inset-bottom));
  text-align: center;
}

@media (max-width: 480px) {
  .page {
    padding: 4rem 1.2rem 3rem;
    justify-content: flex-start;
  }
}

/* ---------- Divider ---------- */
.divider {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 70%;
  max-width: 14rem;
  margin: 1.1rem auto;
  opacity: 0;
  animation: fade-in 1s ease forwards 1.2s;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold));
}

.divider::after {
  background: linear-gradient(to left, transparent, var(--gold));
}

.divider span {
  color: var(--gold);
  font-size: 0.9rem;
}

/* ---------- Landing hero ---------- */
.hero-eyebrow {
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--gold-deep);
  opacity: 0;
  animation: fade-in 1s ease forwards 0.2s;
}

.hero-title {
  font-family: 'Great Vibes', 'Brush Script MT', cursive;
  font-weight: 400;
  font-size: clamp(3.2rem, 11vw, 6.5rem);
  line-height: 1.15;
  margin: 0.2em 0 0.05em;
  background: linear-gradient(110deg, var(--gold-deep) 0%, #fff3d6 25%, var(--gold) 50%, #fff3d6 75%, var(--gold-deep) 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
  transform: scale(0.85);
  animation:
    title-pop 1.1s cubic-bezier(0.22, 1, 0.36, 1) forwards 0.4s,
    shimmer-move 5s linear infinite 1.5s;
  filter: drop-shadow(0 2px 10px rgba(201, 163, 90, 0.25));
}

@keyframes shimmer-move {
  0% { background-position: 0% 50%; }
  100% { background-position: -220% 50%; }
}

.hero-sub {
  font-size: clamp(1.05rem, 2.6vw, 1.35rem);
  font-style: italic;
  opacity: 0;
  animation: fade-in 1s ease forwards 0.9s;
  max-width: 32rem;
  margin: 0 auto;
  line-height: 1.7;
  color: var(--ink);
}

.hero-date {
  margin-top: 0.5em;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 1.05rem;
  color: var(--gold-deep);
  opacity: 0;
  animation: fade-in 1s ease forwards 1.1s;
}

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

@keyframes title-pop {
  0% { opacity: 0; transform: scale(0.8) rotate(-2deg); }
  60% { opacity: 1; transform: scale(1.04) rotate(1deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.ornament {
  font-size: 1.7rem;
  color: var(--gold);
  opacity: 0;
  letter-spacing: 0.3em;
  animation: fade-in 1s ease forwards 0.1s, gentle-bob 4s ease-in-out infinite 1.1s;
}

/* ---------- Hero reveal gating (envelope tap) ---------- */
.hero-content .hero-eyebrow,
.hero-content .hero-title,
.hero-content .divider,
.hero-content .hero-sub,
.hero-content .hero-date,
.hero-content .ornament,
.hero-content .options,
.hero-content .countdown,
.hero-content .countdown-caption {
  animation: none;
}

.hero-content.revealed .hero-eyebrow { animation: fade-in 1s ease forwards 0.2s; }
.hero-content.revealed .hero-title {
  animation:
    title-pop 1.1s cubic-bezier(0.22, 1, 0.36, 1) forwards 0.4s,
    shimmer-move 5s linear infinite 1.5s;
}
.hero-content.revealed .divider { animation: fade-in 1s ease forwards 1.2s; }
.hero-content.revealed .hero-sub { animation: fade-in 1s ease forwards 0.9s; }
.hero-content.revealed .hero-date { animation: fade-in 1s ease forwards 1.1s; }
.hero-content.revealed .ornament { animation: fade-in 1s ease forwards 0.1s, gentle-bob 4s ease-in-out infinite 1.1s; }
.hero-content.revealed .countdown { animation: fade-in 1s ease forwards 1.3s; }
.hero-content.revealed .countdown-caption { animation: fade-in 1s ease forwards 1.4s; }
.hero-content.revealed .options { animation: fade-in 1s ease forwards 1.6s; }

/* ---------- Countdown timer ---------- */
.countdown {
  display: flex;
  gap: 0.9rem;
  justify-content: center;
  margin-top: 1.1rem;
  opacity: 0;
}

.countdown-item {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--gold-light);
  border-radius: 0.8rem;
  padding: 0.6rem 0.8rem;
  min-width: 3.4rem;
  box-shadow: 0 6px 16px rgba(110, 80, 50, 0.12);
}

.countdown-num {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold-deep);
}

.countdown-label {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
}

.countdown-caption {
  font-size: 0.85rem;
  font-style: italic;
  opacity: 0;
  margin-top: 0.5rem;
}

/* ---------- Confetti burst ---------- */
.confetti-piece {
  position: fixed;
  top: -5%;
  width: 8px;
  height: 14px;
  opacity: 0.95;
  animation: confetti-fall linear forwards;
  z-index: 60;
  pointer-events: none;
}

@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(540deg); opacity: 0.9; }
}

/* ---------- Option cards ---------- */
.options {
  display: flex;
  flex-wrap: wrap;
  gap: 1.8rem;
  justify-content: center;
  margin-top: 2.6rem;
  opacity: 0;
  animation: fade-in 1s ease forwards 1.5s;
}

.option-card {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--gold-light);
  border-radius: 1.3rem;
  padding: 2.3rem 2rem;
  width: 15.5rem;
  text-decoration: none;
  color: var(--ink);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 28px rgba(110, 80, 50, 0.14);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.35s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  font-family: inherit;
}

.option-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.75) 50%, transparent 70%);
  transform: translateX(-130%);
  transition: transform 0.7s ease;
  pointer-events: none;
  z-index: 1;
}

.option-card:hover::before {
  transform: translateX(130%);
}

.option-card::after {
  content: '';
  position: absolute;
  inset: 9px;
  border: 1px dashed rgba(201, 163, 90, 0.4);
  border-radius: 0.9rem;
  pointer-events: none;
}

.option-card-ribbon {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 3.2rem;
  height: 5px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(120deg, var(--gold-deep), var(--gold));
}

.option-card:hover,
.option-card:focus-visible {
  transform: translateY(-8px) scale(1.03) rotate(-0.6deg);
  box-shadow: 0 18px 36px rgba(110, 80, 50, 0.22);
  border-color: var(--gold);
}

.option-card:nth-child(2):hover,
.option-card:nth-child(2):focus-visible {
  transform: translateY(-8px) scale(1.03) rotate(0.6deg);
}

.option-icon-wrap {
  width: 4.2rem;
  height: 4.2rem;
  margin: 0 auto 0.9rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, #fff7e8, var(--gold-light));
  box-shadow: 0 4px 14px rgba(201, 163, 90, 0.35), inset 0 0 0 1px rgba(201, 163, 90, 0.4);
  position: relative;
}

.option-icon-wrap::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(201, 163, 90, 0.55);
  animation: ring-pulse 2.6s ease-in-out infinite;
}

@keyframes ring-pulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  70% { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(1.25); opacity: 0; }
}

.option-icon {
  font-size: 2rem;
  display: block;
  animation: gentle-bob 3s ease-in-out infinite;
}

.option-card:nth-child(2) .option-icon {
  animation-delay: 0.4s;
}

.option-card:nth-child(2) .option-icon-wrap::before {
  animation-delay: 0.6s;
}

@keyframes gentle-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(3deg); }
}

.option-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.option-desc {
  font-size: 0.92rem;
  opacity: 0.8;
  line-height: 1.5;
}

.option-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 1rem;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--gold-deep);
}

.option-arrow {
  display: inline-block;
  transition: transform 0.3s ease;
}

.option-card:hover .option-arrow {
  transform: translateX(4px);
}

/* ---------- Invitation page ---------- */
.invite-header {
  margin-bottom: 0.6rem;
}

.invite-eyebrow {
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-size: 0.74rem;
  color: var(--gold-deep);
  opacity: 0;
  animation: fade-in 1s ease forwards 0.1s;
}

.invite-title {
  font-family: 'Great Vibes', 'Brush Script MT', cursive;
  font-weight: 400;
  font-size: clamp(2.8rem, 8.5vw, 4.6rem);
  line-height: 1.2;
  margin: 0.2em 0;
  background: linear-gradient(110deg, var(--gold-deep) 0%, #fff3d6 25%, var(--gold) 50%, #fff3d6 75%, var(--gold-deep) 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
  transform: scale(0.9);
  animation:
    title-pop 1s cubic-bezier(0.22, 1, 0.36, 1) forwards 0.3s,
    shimmer-move 5s linear infinite 1.3s;
}

.invite-date {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  color: var(--gold-deep);
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
  opacity: 0;
  animation: fade-in 1s ease forwards 0.9s;
}

.invite-message {
  max-width: 36rem;
  line-height: 1.8;
  margin: 1.1rem auto 2.2rem;
  font-size: 1.1rem;
  font-style: italic;
  opacity: 0;
  animation: fade-in 1s ease forwards 1.1s;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
  max-width: 38rem;
}

.event-card {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--gold-light);
  border-radius: 1.3rem;
  padding: 1.9rem;
  text-align: left;
  box-shadow: 0 10px 26px rgba(110, 80, 50, 0.12);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.35s ease;
  position: relative;
}

.event-card::after {
  content: '';
  position: absolute;
  inset: 9px;
  border: 1px dashed rgba(201, 163, 90, 0.4);
  border-radius: 0.9rem;
  pointer-events: none;
}

.event-card.in-view {
  opacity: 1;
  transform: translateY(0);
}

.event-card.in-view:hover {
  box-shadow: 0 16px 34px rgba(110, 80, 50, 0.2);
  border-color: var(--gold);
}

.event-header-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.event-icon-wrap {
  width: 3.6rem;
  height: 3.6rem;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, #fff7e8, var(--gold-light));
  box-shadow: 0 4px 14px rgba(201, 163, 90, 0.35), inset 0 0 0 1px rgba(201, 163, 90, 0.4);
  position: relative;
}

.event-icon-wrap::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(201, 163, 90, 0.55);
  animation: ring-pulse 2.6s ease-in-out infinite;
}

.event-card:nth-child(2) .event-icon-wrap::before {
  animation-delay: 0.6s;
}

.event-icon {
  font-size: 1.6rem;
}

.event-time {
  display: inline-block;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
  font-size: 0.88rem;
  background: linear-gradient(120deg, var(--gold-deep), var(--gold));
  padding: 0.25rem 0.7rem;
  border-radius: 1rem;
  box-shadow: 0 4px 10px rgba(110, 80, 50, 0.25);
}

.event-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
}

.event-address {
  opacity: 0.85;
  line-height: 1.6;
  margin-bottom: 1.1rem;
}

.event-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.directions-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(120deg, var(--gold-deep), var(--gold));
  color: #fff;
  text-decoration: none;
  padding: 0.65rem 1.15rem;
  border-radius: 2rem;
  font-size: 0.92rem;
  font-family: 'Cormorant Garamond', serif;
  box-shadow: 0 4px 14px rgba(201, 163, 90, 0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.calendar-btn {
  background: rgba(255, 255, 255, 0.7);
  color: var(--gold-deep);
  border: 1px solid var(--gold-light);
  box-shadow: none;
}

.calendar-btn:hover {
  box-shadow: 0 6px 16px rgba(201, 163, 90, 0.25);
}

.directions-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  transform: translateX(-130%);
  transition: transform 0.7s ease;
}

.directions-btn:hover::before {
  transform: translateX(130%);
}

.directions-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(201, 163, 90, 0.45);
}

.back-link {
  margin-top: 3rem;
  display: inline-block;
  color: var(--ink);
  opacity: 0.7;
  text-decoration: none;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
  transition: opacity 0.3s ease;
}

.back-link:hover {
  opacity: 1;
}

.back-link-top {
  position: fixed;
  top: max(1.4rem, env(safe-area-inset-top));
  left: max(1.6rem, env(safe-area-inset-left));
  z-index: 40;
  display: inline-block;
  color: var(--gold-deep);
  opacity: 0.85;
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(6px);
  border: 1px solid var(--gold-light);
  border-radius: 1.4rem;
  padding: 0.45rem 0.9rem;
  box-shadow: 0 6px 16px rgba(110, 80, 50, 0.12);
  transition: opacity 0.3s ease, transform 0.25s ease;
}

.back-link-top:hover {
  opacity: 1;
  transform: translateY(-1px);
}

@media (max-width: 480px) {
  .back-link-top {
    font-size: 0.78rem;
    padding: 0.4rem 0.75rem;
  }
}

@media (max-width: 480px) {
  .options {
    flex-direction: column;
    align-items: center;
    gap: 1.1rem;
    margin-top: 2.2rem;
  }
  .option-card {
    width: 100%;
    max-width: 22rem;
    padding: 1.7rem 1.4rem;
  }
  .timeline {
    gap: 1.4rem;
  }
  .event-card {
    padding: 1.5rem;
  }
  .directions-btn {
    width: 100%;
    justify-content: center;
    padding: 0.85rem 1.1rem;
  }
  .hero-sub {
    font-size: 1.05rem;
  }
}

/* ---------- Game page ---------- */
.game-page {
  padding-top: 5vh;
}

.game-section {
  width: 100%;
  max-width: 32rem;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--gold-light);
  border-radius: 1.3rem;
  padding: 2rem 1.6rem;
  margin-bottom: 2rem;
  box-shadow: 0 10px 26px rgba(110, 80, 50, 0.12);
}

.game-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
  color: var(--gold-deep);
}

.game-blurb {
  opacity: 0.85;
  margin-bottom: 1.2rem;
  font-style: italic;
}

.riddle-text {
  font-size: 1.1rem;
  line-height: 1.7;
}

.game-btn {
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}

.game-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.game-form {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 1.2rem;
  flex-wrap: wrap;
}

.game-form input {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--gold-light);
  border-radius: 1.4rem;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  min-width: 11rem;
}

.game-form input:focus {
  outline: none;
  border-color: var(--gold);
}

.game-feedback {
  min-height: 1.4rem;
  margin-top: 1rem;
  color: var(--gold-deep);
}

/* ---------- Winning modal ---------- */
.win-modal {
  position: fixed;
  inset: 0;
  background: rgba(90, 74, 63, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  z-index: 50;
}

.win-modal.show {
  opacity: 1;
  pointer-events: auto;
}

.win-card {
  background: linear-gradient(160deg, #fffaf0, var(--cream));
  border: 1px solid var(--gold);
  border-radius: 1.4rem;
  padding: 2.2rem 1.8rem;
  max-width: 24rem;
  text-align: center;
  box-shadow: 0 20px 50px rgba(110, 80, 50, 0.35);
  transform: scale(0.85);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.win-modal.show .win-card {
  transform: scale(1);
}

.win-confetti {
  font-size: 1.6rem;
  margin-bottom: 0.4rem;
}

.win-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: var(--gold-deep);
  margin-bottom: 0.6rem;
}

.win-code {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #fff;
  background: linear-gradient(120deg, var(--gold-deep), var(--gold));
  padding: 0.5rem 1.2rem;
  border-radius: 0.6rem;
  display: inline-block;
  margin: 0.8rem 0;
  box-shadow: 0 6px 16px rgba(201, 163, 90, 0.4);
}

.win-instructions {
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0.8rem 0 1.2rem;
}

.win-steps {
  text-align: left;
  list-style: none;
  counter-reset: win-step;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.win-steps li {
  position: relative;
  padding-left: 2rem;
  counter-increment: win-step;
}

.win-steps li::before {
  content: counter(win-step);
  position: absolute;
  left: 0;
  top: -0.05rem;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: linear-gradient(120deg, var(--gold-deep), var(--gold));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.win-close {
  margin-top: 0.8rem;
}

@media (max-width: 480px) {
  .game-section {
    padding: 1.6rem 1.2rem;
  }
  .game-form input {
    width: 100%;
  }
}

/* ---------- Tambola / Housie ticket ---------- */
.tambola-section {
  max-width: 40rem;
}

.tambola-ticket {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 3px;
  background: var(--gold);
  border: 3px solid var(--gold-deep);
  border-radius: 0.6rem;
  padding: 3px;
  box-shadow: 0 10px 30px rgba(110, 80, 50, 0.2);
}

.tambola-cell {
  position: relative;
  min-width: 0;
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: clamp(0.8rem, 3.2vw, 1.5rem);
  border-radius: 0.25rem;
  overflow: hidden;
}

.tambola-blank {
  background: repeating-linear-gradient(
    45deg,
    rgba(201, 163, 90, 0.12),
    rgba(201, 163, 90, 0.12) 4px,
    transparent 4px,
    transparent 8px
  );
  background-color: rgba(255, 255, 255, 0.4);
}

.tambola-num {
  background: #fffaf0;
  color: var(--ink);
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease;
  min-height: 2.6rem;
  touch-action: manipulation;
}

.tambola-num:hover {
  background: #fff;
}

.tambola-num:active {
  transform: scale(0.92);
}

.tambola-num:focus-visible {
  outline: 3px solid var(--gold-deep);
  outline-offset: 2px;
  z-index: 1;
}

.tambola-num-text {
  transition: opacity 0.2s ease, text-decoration-color 0.2s ease;
}

.tambola-check {
  position: absolute;
  bottom: 2px;
  right: 3px;
  font-size: 0.6em;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.2s ease, transform 0.2s ease;
  color: #fff;
}

.tambola-num.marked {
  background: linear-gradient(135deg, #c0392b, #8a2418);
  color: #fff;
}

.tambola-num.marked .tambola-num-text {
  opacity: 0.95;
}

.tambola-num.marked .tambola-check {
  opacity: 1;
  transform: scale(1);
}

.tambola-controls {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.4rem;
}

.tambola-hint {
  text-align: center;
  font-size: 0.82rem;
  opacity: 0.7;
  margin-top: 1rem;
  font-style: italic;
}

@media (max-width: 480px) {
  .tambola-ticket {
    gap: 2px;
    padding: 2px;
  }
  .tambola-cell {
    font-size: clamp(0.8rem, 4.2vw, 1.2rem);
    min-height: 2.2rem;
  }
}
