:root {
  --cream: #f5e8cc;
  --paper: #fff5df;
  --rose: #d98b88;
  --rose-soft: #edb2aa;
  --mustard: #d3a328;
  --blue: #9cbec3;
  --burgundy: #8f2431;
  --burgundy-deep: #5d1722;
  --ink: #3d2a26;
  --gold: #b98524;
  --shadow: rgba(71, 29, 32, 0.25);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--cream);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Georgia, "Noto Serif Georgian", serif;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.campaign-page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background:
    linear-gradient(90deg, rgba(143, 36, 49, 0.08) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(rgba(143, 36, 49, 0.08) 1px, transparent 1px) 0 0 / 56px 56px,
    var(--cream);
}

.campaign-page::before,
.campaign-page::after {
  content: "";
  position: absolute;
  top: 20%;
  bottom: 12%;
  width: clamp(28px, 5vw, 84px);
  border: 2px solid var(--burgundy);
  background: repeating-linear-gradient(
    135deg,
    var(--rose-soft) 0 22px,
    var(--paper) 22px 44px
  );
}

.campaign-page::before {
  left: -12px;
}

.campaign-page::after {
  right: -12px;
}

.awning {
  height: 24px;
  background: repeating-linear-gradient(
    90deg,
    var(--burgundy) 0 48px,
    var(--paper) 48px 96px,
    var(--blue) 96px 144px,
    var(--paper) 144px 192px
  );
  border-bottom: 3px solid var(--gold);
}

.brand-lockup {
  justify-self: center;
  text-align: center;
  margin-top: clamp(30px, 6vh, 76px);
  letter-spacing: 0.19em;
  color: var(--burgundy);
}

.brand-lockup .brand-kicker {
  display: block;
  font-family: Arial, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  margin-bottom: 5px;
}

.brand-lockup strong {
  font-family: Arial, sans-serif;
  font-size: clamp(0.82rem, 2vw, 1.05rem);
}

.birthday-stage {
  position: relative;
  align-self: center;
  justify-self: center;
  text-align: center;
  width: min(880px, 86vw);
  padding: 28px;
}

.eyebrow,
.step-number {
  margin: 0 0 12px;
  color: var(--burgundy);
  font-family: Arial, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.birthday-stage h1,
.game-card h2 {
  margin: 0;
  color: var(--burgundy);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.92;
}

.birthday-stage h1 {
  font-size: clamp(3.5rem, 10vw, 8rem);
  text-shadow: 3px 3px 0 var(--paper), 6px 6px 0 rgba(185, 133, 36, 0.28);
}

.intro {
  margin: 26px auto 18px;
  max-width: 540px;
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.65;
}

.countdown-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border: 1px solid var(--burgundy);
  background: rgba(255, 245, 223, 0.78);
  color: var(--burgundy);
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.countdown-card strong {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--burgundy);
  color: var(--paper);
  font-size: 1rem;
}

.stars {
  position: absolute;
  top: 44%;
  color: var(--gold);
  font-size: clamp(1.1rem, 3vw, 2rem);
  letter-spacing: 0.15em;
}

.left-stars {
  left: 0;
}

.right-stars {
  right: 0;
}

.page-footer {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  min-height: 58px;
  padding: 12px max(32px, 8vw);
  border-top: 2px solid var(--burgundy);
  background: var(--rose-soft);
  color: var(--burgundy-deep);
  font-family: Arial, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.page-footer span:last-child {
  text-align: right;
}

.quiet-button {
  border: 1px solid var(--burgundy);
  padding: 8px 14px;
  background: var(--paper);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 260ms ease, visibility 260ms ease;
}

.modal.visible {
  visibility: visible;
  opacity: 1;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(61, 42, 38, 0.68);
  backdrop-filter: blur(7px);
}

.game-card {
  position: relative;
  z-index: 1;
  width: min(900px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: clamp(36px, 5vw, 64px) clamp(22px, 6vw, 72px) 42px;
  border: 3px solid var(--burgundy);
  border-radius: 4px;
  background:
    radial-gradient(circle at 50% 0%, rgba(217, 139, 136, 0.17), transparent 34%),
    linear-gradient(rgba(185, 133, 36, 0.08) 1px, transparent 1px) 0 0 / 100% 36px,
    var(--paper);
  box-shadow: 0 26px 90px rgba(38, 11, 16, 0.42);
  text-align: center;
  transform: translateY(18px) scale(0.98);
  transition: transform 320ms cubic-bezier(0.2, 0.85, 0.3, 1.1);
}

.modal.visible .game-card {
  transform: translateY(0) scale(1);
}

.game-card::before,
.game-card::after {
  content: "";
  position: absolute;
  inset: 12px;
  pointer-events: none;
  border: 1px solid var(--gold);
}

.game-card::after {
  inset: 18px;
  border-color: rgba(143, 36, 49, 0.32);
}

.close-button {
  position: absolute;
  z-index: 3;
  top: 22px;
  right: 24px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--burgundy);
  border-radius: 50%;
  background: var(--paper);
  color: var(--burgundy);
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-size: 1.5rem;
  line-height: 1;
}

.ticket-edge {
  position: absolute;
  left: 50%;
  width: 160px;
  height: 12px;
  transform: translateX(-50%);
  background: repeating-linear-gradient(90deg, var(--burgundy) 0 12px, transparent 12px 20px);
}

.top-edge {
  top: 9px;
}

.bottom-edge {
  bottom: 9px;
}

.step {
  display: none;
  position: relative;
  z-index: 2;
  animation: step-in 360ms ease both;
}

.step.active {
  display: block;
}

@keyframes step-in {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.game-card h2 {
  font-size: clamp(2.25rem, 6vw, 4.7rem);
}

.step-copy {
  margin: 18px auto 26px;
  max-width: 540px;
  font-size: 1rem;
  line-height: 1.6;
}

.gift-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 2vw, 24px);
  margin: 10px auto 0;
}

.gift-button {
  position: relative;
  min-width: 0;
  padding: 0 0 42px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.gift-window {
  position: relative;
  display: block;
  aspect-ratio: 0.86;
  overflow: hidden;
  filter: drop-shadow(0 13px 8px rgba(68, 31, 29, 0.18));
  transition: transform 240ms ease, filter 240ms ease;
}

.gift-button:hover .gift-window,
.gift-button:focus-visible .gift-window {
  transform: translateY(-11px) rotate(-1deg);
  filter: drop-shadow(0 21px 12px rgba(68, 31, 29, 0.25));
}

.gift-button:nth-child(2):hover .gift-window,
.gift-button:nth-child(2):focus-visible .gift-window {
  transform: translateY(-11px) rotate(1deg);
}

.gift-window img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gift-label {
  position: absolute;
  left: 50%;
  bottom: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  transform: translateX(-50%);
  border: 1px solid var(--burgundy);
  border-radius: 50%;
  background: var(--paper);
  color: var(--burgundy);
  font-family: Arial, sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
}

.field-label {
  display: block;
  width: min(420px, 100%);
  margin: 0 auto 8px;
  text-align: left;
  color: var(--burgundy);
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.phone-field {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  width: min(420px, 100%);
  margin: 0 auto;
  border: 2px solid var(--burgundy);
  background: #fffaf0;
}

.phone-field span {
  padding: 15px 14px;
  border-right: 1px solid rgba(143, 36, 49, 0.4);
  color: var(--burgundy);
  font-family: Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
}

.phone-field input,
.otp-field {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: Arial, sans-serif;
  font-size: 1rem;
}

.phone-field input {
  padding: 15px;
}

.otp-field {
  display: block;
  width: min(420px, 100%);
  margin: 0 auto;
  padding: 15px;
  border: 2px solid var(--burgundy);
  background: #fffaf0;
  text-align: center;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.4em;
}

.form-message {
  min-height: 20px;
  margin: 7px auto;
  color: var(--burgundy);
  font-family: Arial, sans-serif;
  font-size: 0.82rem;
}

.primary-button,
.secondary-button {
  min-height: 50px;
  border: 2px solid var(--burgundy);
  padding: 12px 26px;
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.primary-button {
  background: var(--burgundy);
  color: var(--paper);
  box-shadow: 4px 4px 0 var(--mustard);
}

.secondary-button {
  margin-top: 20px;
  background: transparent;
  color: var(--burgundy);
}

.result-seal {
  display: grid;
  place-items: center;
  width: 116px;
  height: 116px;
  margin: 0 auto 18px;
  border: 3px double var(--paper);
  border-radius: 50%;
  outline: 3px solid var(--burgundy);
  background: var(--burgundy);
  color: var(--paper);
  font-family: Arial, sans-serif;
  font-size: 2rem;
  font-weight: 800;
  box-shadow: 0 0 0 8px var(--mustard);
}

.result-step.no-win .result-seal {
  background: var(--blue);
  color: var(--burgundy-deep);
  box-shadow: 0 0 0 8px var(--rose-soft);
}

.voucher {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 24px;
  width: min(540px, 100%);
  margin: 22px auto 0;
  padding: 18px;
  border: 2px dashed var(--burgundy);
  background: var(--cream);
  text-align: left;
}

.voucher.hidden {
  display: none;
}

.voucher canvas {
  display: block;
  width: 116px;
  height: 116px;
  border: 8px solid white;
  background: white;
}

.voucher span,
.voucher small {
  display: block;
  font-family: Arial, sans-serif;
}

.voucher span {
  margin-bottom: 7px;
  color: var(--burgundy);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.voucher strong {
  display: block;
  margin-bottom: 8px;
  color: var(--burgundy-deep);
  font-family: Arial, sans-serif;
  font-size: clamp(1rem, 4vw, 1.45rem);
  word-break: break-word;
}

.voucher small {
  font-size: 0.78rem;
}

@media (max-width: 660px) {
  .campaign-page::before,
  .campaign-page::after {
    width: 32px;
  }

  .stars {
    display: none;
  }

  .page-footer {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 12px 20px;
  }

  .page-footer span {
    display: none;
  }

  .game-card {
    padding: 46px 18px 34px;
  }

  .gift-grid {
    gap: 2px;
  }

  .gift-button {
    padding-bottom: 34px;
  }

  .gift-label {
    width: 30px;
    height: 30px;
  }

  .voucher {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
}

@media (max-width: 420px) {
  .modal {
    align-items: stretch;
  }

  .game-card {
    width: 100vw;
    max-height: 100dvh;
    min-height: 100dvh;
    border-width: 0;
    border-radius: 0;
    padding: 64px 16px 30px;
  }

  .game-card::before {
    inset: 9px;
  }

  .game-card::after {
    inset: 14px;
  }

  .close-button {
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
  }

  .game-card h2 {
    font-size: clamp(2rem, 11vw, 3rem);
  }

  .step-copy {
    margin: 14px auto 18px;
    font-size: 0.95rem;
  }

  .gift-grid {
    width: 100%;
    gap: 0;
  }

  .gift-window {
    aspect-ratio: 0.78;
  }

  .primary-button,
  .secondary-button {
    width: min(420px, 100%);
    min-height: 54px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
