@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Jost:wght@300;400;500;600&family=Parisienne&display=swap');

:root {
  --color-bg: #faf7f2;
  --color-bg-alt: #ffffff;
  --color-text: #33302c;
  --color-text-soft: #6b6459;
  --color-primary: #7c8b6f;
  --color-primary-dark: #5f6d54;
  --color-sage-deep: #4a5640;
  --color-accent: #c9a15a;
  --color-blush: #ecdfd6;
  --color-border: #e3dcd0;
  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-script: 'Parisienne', 'Brush Script MT', cursive;
  --font-body: 'Jost', 'Segoe UI', sans-serif;
  --max-width: 1080px;
  --paper-texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-primary-dark);
  margin: 0 0 0.5em;
  letter-spacing: 0.01em;
}

h1 { font-size: clamp(2.5rem, 6vw, 4rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
h3 { font-size: 1.4rem; }

p { margin: 0 0 1em; }

a { color: var(--color-primary-dark); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Script accent heading, paired under a .hero-eyebrow kicker */
.script {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(2.6rem, 6vw, 3.8rem);
  letter-spacing: 0;
  line-height: 1.15;
  color: var(--color-primary-dark);
  margin: 0 0 0.4em;
}

/* Header / nav */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(250, 247, 242, 0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--color-border);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.site-header--overlay {
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
}

.site-header-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2.5rem;
  padding-top: 1.2rem;
  padding-bottom: 1.2rem;
}

.brand {
  order: 2;
  justify-self: center;
  position: relative;
  display: inline-flex;
  align-items: center;
  font-family: var(--font-script);
  font-size: 2.3rem;
  font-weight: 400;
  color: var(--color-primary-dark);
  text-decoration: none;
  flex: none;
}

.site-header--overlay .brand {
  color: #fff;
}

.brand-mark {
  height: 3.4rem;
  width: auto;
  display: block;
}

/* Enlarge the ampersand-ish middle of the monogram invisibly, since it
   takes 4 quick clicks to find the hidden game and it's a small target
   to hit precisely. */
#brand-amp {
  position: absolute;
  left: 42%;
  top: 50%;
  width: 45%;
  height: 3.75rem;
  transform: translate(-50%, -50%);
}

/* Same trick, smaller footer text: a second hidden way to find the
   pixel-maze game via the footer's "&". */
#footer-amp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  min-height: 2.25rem;
  margin: -0.75rem -0.6rem;
  cursor: pointer;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--color-text);
}

.site-header--overlay .nav-toggle span {
  background: #fff;
}

.site-nav-links {
  display: contents;
}

.site-nav-left { order: 1; justify-self: end; }
.site-nav-right { order: 3; justify-self: start; }

.site-nav ul {
  display: flex;
  gap: 1.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  text-decoration: none;
  color: var(--color-text);
  font-family: var(--font-heading);
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
}

.site-header--overlay .site-nav a {
  color: #fff;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--color-primary-dark);
  border-bottom-color: var(--color-accent);
}

.site-header--overlay .site-nav a:hover,
.site-header--overlay .site-nav a.active {
  color: #fff;
  border-bottom-color: #fff;
}

@media (max-width: 720px) {
  .site-header-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }

  .brand { order: 0; justify-self: auto; }

  .nav-toggle { display: flex; }

  .site-nav-links {
    display: block;
    order: 3;
    flex-basis: 100%;
    width: 100%;
  }

  .site-nav-left,
  .site-nav-right {
    display: none;
    width: 100%;
  }

  .site-nav-links.open .site-nav-left,
  .site-nav-links.open .site-nav-right {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding-bottom: 1rem;
  }

  .site-nav li {
    border-top: 1px solid var(--color-border);
  }

  .site-nav a {
    display: block;
    padding: 0.85rem 0;
  }

  .site-header--overlay .site-nav li {
    border-top-color: rgba(255, 255, 255, 0.25);
  }
}

/* Fixed header offset — every page pushes content down, except the
   full-bleed hero page which wants the header to float over the photo. */
main {
  padding-top: 96px;
}

body.has-hero-photo main {
  padding-top: 0;
}

/* Footer: full-bleed black-and-white church photo on every page */
.site-footer--photo {
  position: relative;
  overflow: hidden;
  margin-top: 4rem;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
}

.site-footer-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%);
  z-index: 0;
}

.site-footer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(20, 19, 16, 0.55);
  z-index: 1;
}

.site-footer-content {
  position: relative;
  z-index: 2;
}

.site-footer-content .brand {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 1.8rem;
  color: #fff;
}

.site-footer-date {
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 1.25rem;
}

.site-footer-contact {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1.75rem;
}

.site-footer-contact a {
  color: #fff;
}

.back-to-top {
  display: inline-block;
  padding: 0.75rem 1.8rem;
  background: transparent;
  border: 1px solid #fff;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.2s ease, color 0.2s ease;
}

.back-to-top:hover {
  background: #fff;
  color: var(--color-primary-dark);
}

/* Hero */
.hero {
  text-align: center;
  padding: 5rem 1.5rem 4rem;
}

.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.85rem;
  color: var(--color-accent);
  margin-bottom: 1rem;
}

.hero-date {
  font-size: 1.2rem;
  color: var(--color-text-soft);
  margin-bottom: 2.5rem;
}

/* Full-bleed photo hero (home page) */
.hero--photo {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8rem 1.5rem 4rem;
  overflow: hidden;
}

.hero--short {
  min-height: 0;
  padding: 3.5rem 1.5rem;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  filter: grayscale(100%);
  z-index: 0;
}

.hero-bg--color {
  filter: none;
}

/* Slow zoom-out on first load, like a reverse Ken Burns effect */
@keyframes heroZoomOut {
  from {
    transform: scale(1.15);
  }
  to {
    transform: scale(1);
  }
}

.hero-bg--zoom {
  animation: heroZoomOut 9s ease-out forwards;
}

@media (prefers-reduced-motion: reduce) {
  .hero-bg--zoom {
    animation: none;
  }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(30, 28, 22, 0.32) 0%, rgba(30, 28, 22, 0.5) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  flex: none;
}

.hero--photo .hero-eyebrow {
  color: #fff;
  opacity: 0.9;
  font-size: 1.15rem;
}

.hero--photo h1 {
  color: #fff;
  font-size: clamp(3.8rem, 11vw, 7.5rem);
}

.hero--photo .hero-date {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.65rem;
}

/* Countdown */
.countdown {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin: 2rem 0;
}

.countdown-unit {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 1rem 1.4rem;
  min-width: 90px;
}

.countdown-unit strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 2.2rem;
  color: var(--color-primary-dark);
}

.countdown-unit span {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-soft);
}

.countdown-done {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--color-primary-dark);
}

.hero--photo .countdown-unit {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(4px);
}

.hero--photo .countdown-unit strong,
.hero--photo .countdown-unit span {
  color: #fff;
}

.hero--photo .countdown-unit span {
  opacity: 0.8;
}

/* Plain countdown (no card backgrounds) — used on the countdown photo section */
.countdown--plain {
  gap: 0.5rem;
  align-items: flex-start;
}

.countdown--plain .countdown-unit {
  position: relative;
  background: none;
  border: none;
  padding: 0 0.6rem;
  min-width: 0;
}

.countdown--plain .countdown-unit strong {
  font-size: clamp(2.3rem, 6vw, 3.8rem);
  line-height: 1;
}

.countdown--plain .countdown-unit:not(:last-child)::after {
  content: ':';
  position: absolute;
  top: -0.05em;
  right: -0.6rem;
  font-family: var(--font-heading);
  font-size: clamp(2.3rem, 6vw, 3.8rem);
  line-height: 1;
  color: inherit;
}

/* Envelope + card + polaroid */
.envelope-wrap {
  text-align: center;
  padding: 1rem 0 0.5rem;
}

.envelope {
  position: relative;
  width: min(460px, 90%);
  aspect-ratio: 4096 / 3072;
  margin: 0 auto 3.5rem;
  filter: drop-shadow(0 16px 26px rgba(51, 48, 44, 0.25));
}

/* Real photographed envelope graphic — see SETUP.md for how to swap it */
.envelope-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 1;
}

/* Text overlaid on the blank card in the photo */
.envelope-card {
  position: absolute;
  z-index: 2;
  top: 24%;
  left: 50%;
  width: 34%;
  transform: translateX(-50%);
  text-align: center;
}

.envelope-card p {
  margin: 0 0 0.3em;
}

.envelope-names {
  font-family: var(--font-heading);
  font-size: clamp(1rem, 2.6vw, 1.4rem);
  letter-spacing: 0.06em;
  color: var(--color-primary-dark);
}

.envelope-date {
  font-family: var(--font-heading);
  font-style: italic;
  color: var(--color-text-soft);
  font-size: clamp(0.8rem, 2vw, 1rem);
}

.envelope-venue {
  font-size: clamp(0.65rem, 1.6vw, 0.78rem);
  color: var(--color-text-soft);
}

.envelope-monogram {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 16%;
  transform: translateX(-50%);
  margin: 0;
  width: clamp(50px, 11vw, 80px);
  height: auto;
}

.polaroid {
  position: absolute;
  z-index: 3;
  right: -2%;
  bottom: -8%;
  width: 30%;
  background: var(--color-bg-alt);
  padding: 6px 6px 20px;
  box-shadow: 0 12px 22px rgba(51, 48, 44, 0.22);
  transform: rotate(6deg);
}

.polaroid img {
  width: 100%;
  display: block;
}

/* Scroll reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-left {
  transform: translateX(-50px);
}

.reveal-right {
  transform: translateX(50px);
}

.reveal.reveal-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Framed circular photo (used inline within a section, e.g. Our Story) */
.framed-photo {
  width: 220px;
  height: 220px;
  margin: 2.5rem auto 0;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--color-bg-alt);
  box-shadow: 0 8px 24px rgba(51, 48, 44, 0.15);
}

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

.framed-photo .placeholder-box {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 50%;
}

/* Large rectangular framed photo (e.g. the "Just Us" home page feature) */
.feature-photo {
  width: min(660px, 88%);
  aspect-ratio: 4 / 5;
  margin: 2.5rem auto 0;
  overflow: hidden;
  border-radius: 4px;
  border: 8px solid var(--color-bg-alt);
  box-shadow: 0 14px 32px rgba(51, 48, 44, 0.2);
}

.feature-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}

/* Anchor targets: offset for the sticky header */
main section[id] {
  scroll-margin-top: 96px;
}

/* Sections */
.section {
  padding: 3.5rem 0;
}

.section--alt {
  background: var(--color-bg-alt);
}

.section--paper {
  background-color: var(--color-bg);
  background-image: var(--paper-texture);
}

.section--sage {
  background-color: var(--color-sage-deep);
  background-image: var(--paper-texture);
  color: rgba(255, 255, 255, 0.9);
}

.section--sage h2,
.section--sage .script {
  color: #fff;
}

.section--sage .hero-eyebrow {
  color: rgba(255, 255, 255, 0.75);
}

.section--sage .section-intro {
  color: rgba(255, 255, 255, 0.85);
}

.section-intro {
  max-width: 640px;
  margin: 0 auto 2.5rem;
  text-align: center;
  color: var(--color-text-soft);
}

.story-text {
  max-width: 680px;
  margin: 0 auto;
}

.story-text p {
  margin: 0 0 1.4rem;
}

.story-text p:last-child {
  margin-bottom: 0;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.85rem 2.2rem;
  background: transparent;
  color: var(--color-primary-dark);
  border: 1px solid var(--color-primary-dark);
  border-radius: 2px;
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn:hover {
  background: var(--color-primary-dark);
  color: #fff;
}

.btn-secondary {
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: #fff;
}

.hero--photo .btn {
  border-color: #fff;
  color: #fff;
}

.hero--photo .btn:hover {
  background: #fff;
  color: var(--color-primary-dark);
}

.hero--photo .btn-secondary {
  border-color: rgba(255, 255, 255, 0.7);
  color: #fff;
}

.hero--photo .btn-secondary:hover {
  background: #fff;
  color: var(--color-primary-dark);
}

/* Cards / grids */
.grid {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 1.75rem;
  text-align: center;
}

.card h3 {
  margin-bottom: 0.5rem;
}

.card p {
  color: var(--color-text);
}

/* Placeholder / TODO callouts */
.placeholder-box {
  border: 2px dashed var(--color-border);
  border-radius: 10px;
  background: #f2ede4;
  color: var(--color-text-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  font-size: 0.9rem;
  text-align: center;
  padding: 1rem;
}

/* Details / schedule */
.schedule {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 640px;
  margin: 0 auto;
}

.schedule li {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--color-border);
}

.schedule-icon {
  flex: none;
  width: 34px;
  height: 34px;
  color: var(--color-primary-dark);
}

.schedule-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.3;
}

.schedule time {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-primary-dark);
  min-width: 90px;
}

.faq {
  max-width: 700px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid var(--color-border);
  padding: 1.25rem 0;
}

.faq-item h3 {
  margin-bottom: 0.4rem;
}

.placeholder-text {
  font-style: italic;
  color: var(--color-text-soft);
}

/* Gallery: polaroid-style tilted photos */
.gallery-grid {
  display: grid;
  gap: 2rem 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  padding: 1rem 0 2rem;
}

.gallery-item {
  position: relative;
  border: none;
  padding: 10px;
  cursor: pointer;
  background: var(--color-bg-alt);
  text-align: left;
  border-radius: 2px;
  overflow: visible;
  box-shadow: 0 10px 20px rgba(51, 48, 44, 0.18);
  transform: rotate(var(--tilt, -1.5deg));
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-item:nth-child(3n+1) { --tilt: -2deg; }
.gallery-item:nth-child(3n+2) { --tilt: 1.5deg; }
.gallery-item:nth-child(3n+3) { --tilt: -1deg; }

.gallery-item:hover,
.gallery-item:focus-visible {
  transform: rotate(0deg) scale(1.04);
  box-shadow: 0 16px 28px rgba(51, 48, 44, 0.25);
  z-index: 2;
}

.gallery-item img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.gallery-item .placeholder-box {
  height: 220px;
  border-radius: 0;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(30, 27, 22, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 2rem;
}

.lightbox.open {
  display: flex;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 85vh;
  text-align: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 75vh;
  border-radius: 8px;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
}

/* Forms */
.form {
  max-width: 560px;
  margin: 0 auto;
}

.form-row {
  margin-bottom: 1.25rem;
}

.form-row label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.form-row input[type="text"],
.form-row input[type="number"],
.form-row input[type="password"],
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--color-bg-alt);
  color: var(--color-text);
}

.form-row textarea {
  min-height: 100px;
  resize: vertical;
}

.radio-group {
  display: flex;
  gap: 1.5rem;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1rem;
}

.form-status {
  margin-top: 1rem;
  font-size: 0.95rem;
}

.form-status.success {
  color: var(--color-primary-dark);
}

.form-status.error {
  color: #a04444;
}

/* Password gate */
.password-form {
  max-width: 320px;
}

.password-form .form-row {
  text-align: center;
}

.password-form input[type="password"] {
  text-align: center;
}

/* Game */
.game-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  color: var(--color-text-soft);
}

.game-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.game-card {
  aspect-ratio: 1;
  perspective: 800px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.game-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.4s ease;
  display: block;
}

.game-card.flipped .game-card-inner,
.game-card.matched .game-card-inner {
  transform: rotateY(180deg);
}

.game-card-back,
.game-card-front {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  font-size: 2.5rem;
}

.game-card-back {
  background: var(--color-primary);
}

.game-card-front {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  transform: rotateY(180deg);
}

.game-card.matched .game-card-front {
  background: var(--color-blush);
}

.game-win {
  text-align: center;
  margin-top: 1.5rem;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--color-primary-dark);
}

.chase-level {
  text-align: center;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--color-primary-dark);
  margin-bottom: 0.75rem;
}

.chase-board {
  display: flex;
  justify-content: center;
}

.chase-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.chase-board canvas {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  image-rendering: pixelated;
}

.chase-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  border-radius: 8px;
}

.confetti-heart {
  position: absolute;
  top: -20px;
  width: 12px;
  height: 12px;
  background: var(--heart-color, var(--color-accent));
  transform: rotate(-45deg);
  animation: confettiFall linear forwards;
}

.confetti-heart::before,
.confetti-heart::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: inherit;
}

.confetti-heart::before {
  top: -6px;
  left: 0;
}

.confetti-heart::after {
  top: 0;
  left: 6px;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(-45deg);
    opacity: 1;
  }
  100% {
    transform: translateY(var(--fall-distance, 400px)) rotate(300deg);
    opacity: 0;
  }
}

.chase-dpad {
  display: grid;
  grid-template-columns: repeat(3, 3rem);
  grid-template-rows: repeat(2, 3rem);
  gap: 0.5rem;
  justify-content: center;
  margin: 1.5rem auto 0;
}

.chase-dpad button {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

@media (min-width: 720px) {
  .chase-dpad {
    display: none;
  }
}
