:root {
  color-scheme: light;
  --bg: #fff7f0;
  --ink: #2a1c18;
  --muted: #846b61;
  --line: #ead6ca;
  --rose: #d86f8c;
  --peach: #f5b88d;
  --cream: #fffdf9;
  --soft: #ffe9df;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(216, 111, 140, 0.18), transparent 32%),
    radial-gradient(circle at 90% 4%, rgba(245, 184, 141, 0.28), transparent 30%),
    var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.loading {
  overflow: hidden;
}

.confettiCanvas {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}

.preloader {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 40% 30%, rgba(216, 111, 140, 0.22), transparent 28%),
    var(--bg);
  transition: opacity 520ms ease, visibility 520ms ease;
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
}

.preloaderCard {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: min(420px, calc(100vw - 36px));
  padding: 14px 14px 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.82);
  box-shadow: 0 30px 80px rgba(84, 47, 35, 0.16);
}

.loaderSlideshow {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  background: var(--soft);
}

.loaderSlideshow img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.035);
  transition: opacity 900ms ease, transform 2600ms ease;
}

.loaderSlideshow img.active {
  opacity: 1;
  transform: scale(1);
}

.preloader p {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 24px;
  font-weight: 950;
}

.preloader span {
  color: var(--muted);
  font-weight: 750;
}

.siteHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(18px, 5vw, 72px);
}

.logo {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
  text-decoration: none;
}

nav {
  display: flex;
  gap: 22px;
}

a {
  color: inherit;
}

nav a {
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: clamp(28px, 5vw, 68px);
  align-items: center;
  min-height: calc(100vh - 92px);
  padding: 18px clamp(18px, 5vw, 72px) 72px;
}

.heroText {
  max-width: 820px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--rose);
  font-weight: 900;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 900px;
  font-size: clamp(48px, 8vw, 104px);
  line-height: 0.92;
  letter-spacing: 0;
}

.lead {
  max-width: 670px;
  margin: 26px 0 34px;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 23px);
}

.button {
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 20px;
  border-radius: 8px;
  background: var(--rose);
  color: #fff;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 16px 30px rgba(216, 111, 140, 0.22);
}

.heroPhoto {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  box-shadow: 0 26px 60px rgba(84, 47, 35, 0.16);
  transform: rotate(1.5deg);
}

.heroPhoto img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  object-fit: cover;
}

figcaption {
  padding: 12px 4px 2px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.intro {
  padding: 0 clamp(18px, 5vw, 72px) 56px;
}

.intro p {
  max-width: 980px;
  margin: 0;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.76);
  color: var(--ink);
  font-size: clamp(24px, 4vw, 44px);
  line-height: 1.14;
  font-weight: 850;
}

.caseRoller {
  margin: 0 clamp(18px, 5vw, 72px) 72px;
  padding: clamp(18px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 253, 249, 0.92), rgba(255, 233, 223, 0.8)),
    var(--cream);
  box-shadow: 0 26px 60px rgba(84, 47, 35, 0.14);
  overflow: hidden;
}

.caseHead {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.caseHead h2 {
  margin: 0;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 0.95;
}

.caseButton {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.caseButton:disabled {
  cursor: wait;
  opacity: 0.72;
}

.caseWindow {
  position: relative;
  overflow: hidden;
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(42, 28, 24, 0.13), transparent 18%, transparent 82%, rgba(42, 28, 24, 0.13)),
    #fffaf5;
}

.casePointer {
  position: absolute;
  inset: 0 auto 0 50%;
  z-index: 3;
  width: 3px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, var(--rose) 18%, var(--rose) 82%, transparent);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.72), 0 0 24px rgba(216, 111, 140, 0.42);
}

.casePointer::before,
.casePointer::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
}

.casePointer::before {
  top: 0;
  border-top: 14px solid var(--rose);
}

.casePointer::after {
  bottom: 0;
  border-bottom: 14px solid var(--rose);
}

.caseTrack {
  display: flex;
  gap: 12px;
  width: max-content;
  padding: 18px;
  transform: translateX(0);
  will-change: transform;
}

.caseTrack:not(.settled) .caseItem {
  filter: saturate(0.95);
}

.caseItem {
  position: relative;
  flex: 0 0 clamp(132px, 19vw, 190px);
  height: clamp(172px, 24vw, 230px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  box-shadow: 0 14px 28px rgba(84, 47, 35, 0.12);
  transition: transform 220ms ease, box-shadow 220ms ease, filter 220ms ease;
}

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

.caseItem span {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 1;
  padding: 7px 9px;
  border-radius: 7px;
  background: rgba(42, 28, 24, 0.72);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.caseItem.winner {
  transform: translateY(-7px) scale(1.04);
  box-shadow: 0 22px 46px rgba(216, 111, 140, 0.28);
  filter: saturate(1.12);
}

.caseResult {
  min-height: 38px;
  margin-top: 16px;
  color: var(--muted);
  font-size: clamp(18px, 3vw, 28px);
  font-weight: 900;
  text-align: center;
}

.caseResult.win {
  color: var(--rose);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 0 clamp(18px, 5vw, 72px) 72px;
}

.photoCard {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border-radius: 8px;
  background: #000;
  box-shadow: 0 20px 44px rgba(84, 47, 35, 0.15);
}

.photoCard.wide {
  grid-column: span 2;
}

.photoCard.tall {
  grid-row: span 2;
  min-height: 734px;
}

.photoCard img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  display: block;
  opacity: 0.94;
}

.photoCard::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(42, 28, 24, 0.72));
}

.photoCard div {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 1;
  color: #fff;
}

.photoCard span {
  display: block;
  margin-bottom: 5px;
  color: #ffd8e2;
  font-weight: 900;
}

.photoCard h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.05;
}

.revealPhoto {
  opacity: 0;
  transform: translateY(24px) scale(0.985);
  transition: opacity 760ms ease, transform 760ms ease;
}

.heroPhoto.revealPhoto {
  transform: translateY(24px) scale(0.985) rotate(1.5deg);
}

.revealPhoto.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.heroPhoto.revealPhoto.visible {
  transform: translateY(0) scale(1) rotate(1.5deg);
}

@keyframes softBounce {
  from {
    transform: translateY(0) rotate(-2deg);
  }
  to {
    transform: translateY(-8px) rotate(2deg);
  }
}

.photoCard.extra {
  min-height: 320px;
}

.rules {
  padding: 0 clamp(18px, 5vw, 72px) 80px;
}

.rules h2 {
  margin: 0 0 18px;
  font-size: clamp(34px, 5vw, 58px);
}

.ruleGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.ruleGrid p {
  min-height: 170px;
  margin: 0;
  padding: 24px;
  background: var(--cream);
  color: var(--muted);
  font-size: 18px;
  font-weight: 750;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 960px) {
  .hero,
  .gallery,
  .ruleGrid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .heroPhoto {
    max-width: 520px;
  }

  .photoCard,
  .photoCard.tall {
    grid-column: auto;
    grid-row: auto;
    min-height: 430px;
  }
}

@media (max-width: 680px) {
  nav {
    display: none;
  }

  .caseHead {
    align-items: stretch;
    flex-direction: column;
  }

  .caseButton {
    justify-content: center;
    width: 100%;
  }

  .photoCard,
  .photoCard.tall {
    min-height: 360px;
  }

  footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .preloader,
  .loaderSlideshow img,
  .caseTrack,
  .revealPhoto {
    animation: none;
    transition: none;
  }
}
