/* Global styles and custom fonts */

@font-face {
  font-family: 'AvenirLTPro-ExtraBold';
  src: url('fonts/Avenir-LT/AvenirLTPro-ExtraBold.otf') format('opentype');
  font-weight: 800;
  font-style: normal;
}

@font-face {
  font-family: 'AvenirLTPro-Bold';
  src: url('fonts/Avenir-LT/AvenirLTPro-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'AvenirLTPro-Medium';
  src: url('fonts/Avenir-LT/AvenirLTPro-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow-x: hidden; /* prevent horizontal scroll */
}

/* Force hidden elements to be fully removed from layout */
main[hidden], section[hidden], .popup-sheet[hidden], #popupOverlay[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background-color: #FCF6F0; /* global background color */
  color: #000000;
  font-family: 'AvenirLTPro-Medium', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.heading {
  font-family: 'AvenirLTPro-ExtraBold', sans-serif;
  font-size: 30px;
  color: #000000;
  text-transform: uppercase;
  text-align: center;
}

.body-text {
  font-family: 'AvenirLTPro-Medium', sans-serif;
  font-size: 15px;
  color: #000000;
  /*text-transform: capitalize;*/
}

.btn-primary {
  display: inline-block;
  font-family: 'AvenirLTPro-Bold', sans-serif;
  font-size: 16px;
  color: #FFFFFF;
  text-transform: uppercase;
  background-color: #805B9A;
  border: none;
  border-radius: 50px;
  padding: 15px 25px;
  cursor: pointer;
  width: 100%;
}

#submitIngredients {
  margin-top: 20px;
  width: 90%;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Generic button loading state */
button.is-loading,
.btn-primary.is-loading,
.link-text.is-loading,
.how-back.is-loading,
.share-toggle.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.9;
}
button.is-loading::after,
.btn-primary.is-loading::after,
.link-text.is-loading::after,
.how-back.is-loading::after,
.share-toggle.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 14px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.25);
  border-top-color: currentColor; /* adapts to button text color */
  animation: spin 600ms linear infinite;
  transform: translateY(-50%);
}

@keyframes spin {
  from { transform: translateY(-50%) rotate(0deg); }
  to { transform: translateY(-50%) rotate(360deg); }
}

.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

video#introVideo {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  background: transparent;
  border-radius: 0;
}

/* Desktop: constrain intro video width to match other screens */
@media (min-width: 768px) {
  video#introVideo {
    width: 414px;
    left: 50%;
    transform: translateX(-50%);
  }
}

.screen1 {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.mobile-frame {
  width: 100%; /* mobile: full width */
  max-width: none; /* do not cap width on mobile */
  margin: 0 auto;
  padding: 0px 15px;
  position: relative;
  z-index: 5;
  overflow-x: hidden; /* keep content within frame */
}

/* Desktop: cap the mobile frame width to 414px */
@media (min-width: 768px) {
  .mobile-frame {
    max-width: 414px;
  }
}

/* Screen 2 styles */
.screen2 .row-strip {
  width: 100%;
  display: flex;
}
.screen2 .row-strip.left { justify-content: flex-start; }
.screen2 .row-strip.right { justify-content: flex-end; }
.row-img { width: 45px; height: auto; margin-left: 20px;}

/* Partition line before right row strip image */
.screen2 .row-strip.right { position: relative; }
.screen2 .row-strip.right::before {
  content: "";
    position: absolute;
    right: 83px;
    top: 26px;
    height: 1px;
    width: 250px;
    background: #000000;
}

.pop-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  width: 100%;
}
.pop-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.pop-row:last-child {
  margin-top: -20px;
}
.screen2 .row-strip.between { justify-content: flex-end; margin-top: -50px; }

.pop-card {
  position: relative;
  background: transparent;
  border-radius: 16px;
  padding: 16px 12px 28px 12px;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
  animation: fadeIn 400ms ease both;
}
.pop-card.disabled { opacity: 0.5; filter: grayscale(1); cursor: not-allowed; }
.pop-card.disabled .blob { animation: none; }
.pop-card.disabled .pop-img { transform: none; }
.pop-card.disabled .tries-pill { background: #9E9E9E; color: #FFFFFF; }
.pop-card:hover .pop-img { transform: translateY(-2px) scale(1.03); }
.pop-card:hover .blob { animation: pulse 700ms ease infinite; }

.blob {
  position: absolute;
  width: 140px;
  height: 140px;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.8;
}

.pop-img {
  position: relative;
  width: 80px;
  height: auto;
  transition: transform 180ms ease;
}

.tries-pill {
  position: absolute;
  bottom: 6px;
  background: #805B9A;
  color: #fff;
  border-radius: 999px;
  padding: 4px 20px 2px 20px;
  font-family: 'AvenirLTPro-Bold', sans-serif;
  font-size: 12px;
}

/* Total tries pill shown under Play Again buttons (screens 4 & 6) */
.tries-total-pill {
  display: inline-block;
  margin-top: 8px;
  background: #7d7d7d;
  color: #FFFFFF;
  border-radius: 999px;
  padding: 4px 16px 2px 16px;
  font-family: 'AvenirLTPro-Bold', sans-serif;
  font-size: 12px;
  text-align: center;
  position: absolute;
  bottom: 20px;
  transform: translateX(-50%);
  left: 50%;
}

.screen6 .tries-total-pill {bottom: 60px;}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.05); }
  100% { transform: translateX(-50%) scale(1); }
}

/* Screen 3 styles */
.screen3 { position: relative; }
.screen1, .screen2, .screen3, .screen4, .screen5 { overflow-x: hidden; }
.bg-orange {
  position: absolute;
  top: -8%;
  left: -24%;
  width: 200px;
  opacity: 1;
  z-index: 0;
}
.bg-strawberry {
  position: absolute;
  bottom: -10%;
  right: -10%;
  width: 150px;
  opacity: 1;
  z-index: 0;
}

.ingredients-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
}

.ingredient-item {
  text-align: center;
  background: #FFFFFF;
  color: #000000;
  border: 0px solid #E0E0E0;
  border-radius: 999px;
  padding: 10px 8px;
  font-family: 'AvenirLTPro-Medium', sans-serif;
  font-size: 14px;
  text-transform: capitalize;
  cursor: pointer;
}
.ingredient-item.selected {
  background: #805B9A;
  color: #FFFFFF;
  border-color: #805B9A;
}

.hint-text { color: #7E5B99; }
.back-link { margin-top: 8px; }

.center-wrap {
  width: 100%;
  text-align: center;
}

.logo-img {
  width: 150px;
  height: auto;
  padding-top: 40px;
  padding-bottom: 10px;
  display:inline-block;
}

.campaign-img {
  width: 340px;
  height: auto;
}

.links-row {
  display: block;

}

.link-text {
  display: block;
  background: transparent;
  border: none;
  padding: 4px 8px;
  cursor: pointer;
  font-family: 'AvenirLTPro-Medium', sans-serif;
  font-size: 15px;
  color: #000000;
  text-transform: capitalize;
  margin: auto;
}

.inline-icon {
  width: 30px;
  height: 30px;
  margin-right: 10px;
  margin-bottom: -10px;
}

.serial-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
}

#serialInput {
  width: 100%;
  background-color: #FFFFFF;
  color: #000000;
  border: 0px solid #E0E0E0;
  border-radius: 50px;
  padding: 15px 25px;
  font-family: 'AvenirLTPro-Bold', sans-serif;
  font-size: 16px;
  text-transform: uppercase; /* all caps */
  text-align: center;
}

#serialInput::placeholder {
  color: #808080; /* grey placeholder */
}

.feedback {
  font-family: 'AvenirLTPro-Medium', sans-serif;
  font-size: 14px;
  min-height: 20px;
  margin-top: -8px;
}
.feedback.error { color: #D32F2F; }

/* Callout text styling like screen 1 */
#calloutText {
  font-family: 'AvenirLTPro-ExtraBold', sans-serif;
  font-size: 30px;
  color: #000000;
  text-transform: uppercase;
  text-align: center;
  margin-top: 130px;
}

/* Popups (slide from bottom, full screen sheet) */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 1000;
}

.popup-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0; /* full screen */
  background: #FCF6F0;
  transform: translateY(100%);
  transition: transform 240ms ease;
  z-index: 1001;
  display: grid;
  grid-template-rows: auto 1fr;
}

.popup-sheet.active {
  transform: translateY(0);
}

.popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
}

.popup-close {
  background: transparent;
  border: 2px solid #805B9A;
  color: #805B9A;
  border-radius: 10px;
  padding: 8px 12px;
  font-family: 'AvenirLTPro-Bold', sans-serif;
  font-size: 14px;
  text-transform: uppercase;
  cursor: pointer;
}

.popup-content {
  padding: 16px;
  overflow-y: auto;
}

/* How to Play popup styles */
.popup-sheet#popup-howToPlay {
  background: #DEFEEB;
}
.popup-sheet#popup-howToPlay .popup-header { display: none; }
.popup-sheet#popup-howToPlay .popup-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0; /* allow full-bleed logo background */
}
.popup-sheet#popup-howToPlay .popup-content > p { display: none; }
.how-logo-wrap {
  width: 100%;
    background-image: url(assets/TOP_BG.png);
    background-size: cover;
    background-position: bottom center;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-content: center;
    align-items: center;
    padding-bottom: 90px;
}
.popup-terms .how-logo-wrap {
  padding-bottom: 100px;
}
.how-logo { padding-top: 40px; width: 180px; height: auto; }
.how-title { width: 70%; max-width: 320px; height: auto; margin-bottom: 50px; margin-top: 50px; }
.steps { width: 100%; max-width: 360px; }
.step { margin-bottom: 25px; }
.step-title { font-family: 'AvenirLTPro-ExtraBold', sans-serif; color: #1C483E; text-transform: uppercase; font-size: 20px; }
.step-text { font-family: 'AvenirLTPro-Medium', sans-serif; color: #1C483E; font-size: 16px; line-height: 2em;text-transform:none; }
.how-back {
  margin-top: 16px;
  text-transform: uppercase;
  background: transparent;
  color: #1C483E;
  border: 1px solid #1C483E;
  border-radius: 30px;
  padding: 10px 20px;
  font-family: 'AvenirLTPro-Medium', sans-serif;
  width: 150px;
}
.how-decor { position: absolute; bottom: 10%; width: 140px; height: auto; opacity: 1; }
.how-left { left: -55px; transform: rotate(10deg); }
.how-right { right: -45px; transform: rotate(-15deg); top:300px; }

/* Terms & Conditions popup styles (mirror How to Play) */
.popup-sheet#popup-terms { background: #DEFEEB; }
.popup-sheet#popup-terms .popup-header { display: none; }
.popup-sheet#popup-terms .popup-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0;
}
.tnc-content { width: 100%; max-width: 360px; padding-bottom: 100px; }
.tnc-title { width: 70%; max-width: 320px; height: auto; margin-bottom: 30px; margin-top: 40px; }
.tnc-intro {
  color: #FFFFFF; /* white intro text */
  font-family: 'AvenirLTPro-Medium', sans-serif;
  font-size: 14px;
  line-height: 2em;
  margin: 0 20px 24px;
  width: 75%;
  text-transform:none;
}
.tnc-sections { width: 100%; max-width: 360px; text-align: left; margin-top: 60px; }
.tnc-section { margin-bottom: 20px; }
.tnc-section-title {
  font-family: 'AvenirLTPro-ExtraBold', sans-serif;
  color: #1C483E;
  text-transform: uppercase;
  font-size: 18px;
  margin: 0 20px 10px;
}
.tnc-list {
  list-style: none;
  padding: 0;
  margin: 0 20px;
}
.tnc-list li {
  position: relative;
  padding-left: 18px;
  font-family: 'AvenirLTPro-Medium', sans-serif;
  color: #1C483E;
  font-size: 14px;
  line-height: 1.8em;
  margin-bottom: 6px;
  text-transform:none;
}
.tnc-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #805B9A; /* purple disc */
}

/* Prizes popup styles */
.popup-sheet#popup-prizes {
  background-image: url('assets/prizes.bg.png');
  background-position: bottom center;
  background-size: cover;
  background-repeat: no-repeat;
}
.popup-sheet#popup-prizes .popup-header { display: none; }
.popup-sheet#popup-prizes .popup-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative; /* for confetti absolute positioning */
}
.prizes-logo { width: 180px; height: auto; margin-top: 30px; margin-bottom: 10px; }
.prize-hero {
  position: relative;
  width: 100%;
  height: 220px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.prize-confetti {
  position: absolute;
  top:200px;
  background-image: url('assets/prize_confettie.png');
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
  z-index: 1;
  pointer-events: none;
  width: 100%;
  height: 160px;;
}
.box-gif { position: relative; z-index: 2; width: 150px; height: auto; display: block; margin: 0 auto 10px; }
.prizes-card {
  background: #FFFFFF;
  border-radius: 30px;
  padding: 40px;
  width: calc(100% - 20px);
  margin: 60px auto 40px; /* top spacing per spec */
}
.prizes-heading { line-height: 1.4; margin: 40px 0 20px 0; }
.pointers { display: grid; gap: 12px; }
.pointer {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0,0,0,0.19); /* #00000030 equiv */
}
.pointer-icon { width: 50px; height: auto; }
.pointer-text {
  font-family: 'AvenirLTPro-Medium', sans-serif;
  font-size: 16px;
  color: #000000;
  line-height: 1.6;
  text-align: left;
  text-transform:none;
}

/* Screen 4 styles */
.screen4 { position: relative; min-height: 100vh; }
.screen4 .logo-img {
  margin-bottom: 20px;
}
.screen4-bg {
  position: fixed;
  inset: 0;
  background-image: url('assets/screen4-bg.png');
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
  z-index: 0;
}
.score-container {
  position: relative;
  background: #FFFFFF;
  border-radius: 30px;
  width: calc(100% - 20px);
  margin: 0 auto;
  min-height: calc(100vh - 200px); /* space after logo minus 50px approx */
  padding: 24px 30px 100px; /* bottom padding for background image */
  z-index: 1;
}

/* Claim screen styles (Screen 5 & Success) */
.claim-container {
  position: relative;
  background: #FFFFFF;
  border-radius: 30px;
  width: calc(100% - 20px);
  margin: 0 auto;
  padding: 64px 16px 24px; /* top padding to account for offset image */
  margin-top: 100px;
  overflow: visible; /* allow dropdown to extend outside container */
}
.claim-hero {
  width: 80%;
  display: block;
  margin: 0 auto 16px;
  margin-top: -150px;
}
.claim-heading {
  font-family: 'AvenirLTPro-ExtraBold', sans-serif;
  font-size: 24px;
  color: #000000;
  text-transform: uppercase;
  text-align: center;
  margin-top: -50px;
}
.claim-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
}
.input-field {
  width: 100%;
  background-color: #FFFFFF; /* match serial input background */
  color: #000000;
  border: 0px solid #E0E0E0;
  border-radius: 50px; /* match serial input */
  padding: 15px 25px; /* match serial input */
  font-family: 'AvenirLTPro-Bold', sans-serif; /* match serial input */
  font-size: 16px; /* match serial input */
  text-transform: uppercase; /* match serial input */
  text-align: center; /* match serial input */
}
.claim-form .input-field {
    background-color: #efefef;
}
.input-field::placeholder { color: rgba(0,0,0,0.3); }
.share-row { text-align: center; margin-top: 16px; }
.share-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  font-family: 'AvenirLTPro-Medium', sans-serif;
  font-size: 15px;
  color: #000000;
  margin-top:10px;
}
.share-icon { width: 14px; height: auto; margin-top: -3px; }
.share-dropdown { position: relative; display: inline-block; }
.share-menu {
  position: fixed; /* ensure not clipped by containers */
  right: auto; /* allow centering */
  top: auto;
  background: #FFFFFF;
  border: 1px solid #E0E0E0;
  border-radius: 12px;
  padding: 8px;
  display: none;
  min-width: 260px; /* increased dropdown width */
  z-index: 1002;
}
.share-dropdown.active .share-menu { display: block; }
.share-menu a {
  display: block;
  padding: 6px 10px;
  color: #000000;
  text-decoration: none;
  font-family: 'AvenirLTPro-Medium', sans-serif;
}
.share-menu a:hover { background: #F3EAF8; }
.score-value {
  font-size: 90px;
  color: #805B9A; /* purple */
  text-shadow: -4px 0 0 #000000; /* solid 4px towards left */
  line-height: 1;
  text-align: center;
  margin-top: 50px;
}
.score-bg-image {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 240px;
  background-image: url('assets/scorebg.png');
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
  pointer-events: none;
}
.callouts-title { margin-top: 140px; margin-bottom: 8px; color: #000; text-align: center; }
.score-container #ctaButton { position: absolute; left: 30px; right: 30px; bottom: 50px; width: 83%;}
/* Mobile-only blocker overlay */
.desktop-blocker {
  position: fixed;
  inset: 0;
  background: #FCF6F0;
  z-index: 2000;
  display: none;
  place-items: center;
  text-align: center;
  padding: 20px;
}
.desktop-blocker .desktop-message {
  font-family: 'AvenirLTPro-Medium', sans-serif;
  font-size: 18px;
  color: #000000;
}
@media (min-width: 768px) {
  .desktop-blocker { display: grid; }
  .mobile-frame { display: none; }
}
/* Utility: hide total tries pill reliably */
.tries-total-pill.is-hidden {
  display: none !important;
}
/* Centering helper (paired with JS left: 50%) */
.share-menu { left: 50%; transform: translateX(-50%); }