/* Wine Farm — approved Screen 2 / heritage onboarding structure, 2026-10-24.
   Seven ordered parts: eyebrow, title, short copy, large envelope,
   three non-interactive promises, ONE primary button, discreet notes.
   Pure presentation: server-backed grant and replay logic are unchanged. */
body.onboarding-welcome:not(.onboarding-splash) {
  background:#04170f;
  color:#f5e6c3;
}
body.onboarding-welcome:not(.onboarding-splash) .app {
  width:min(100%,520px);
  min-height:100dvh;
  padding:0 !important;
  background:#061c15;
  overflow-x:hidden;
}
#welcome:not([hidden]) {
  position:relative;
  isolation:isolate;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:clamp(9px,1.8svh,15px);
  width:100%;
  min-height:100dvh;
  height:auto;
  margin:0;
  padding:clamp(18px,2.4svh,26px) clamp(13px,4vw,24px)
          max(14px,env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg,#061e17ec 0%,#0b3025ed 22%,#0c251dbd 42%,#061910f0 76%,#03130ff9 100%),
    var(--winefarm-estate-art) center center / cover no-repeat,#051912;
}
#welcome:not([hidden])::before {
  position:absolute;inset:0;z-index:-1;pointer-events:none;content:"";
  background:
    radial-gradient(ellipse 74% 35% at 50% 43%,#c38d4750 0%,transparent 85%),
    linear-gradient(90deg,#000b,transparent 15%,transparent 85%,#0009);
}
#welcome:not([hidden])::after {
  content:"";position:absolute;inset:7px 8px;z-index:-1;
  pointer-events:none;border-left:1px solid #ad88402a;border-right:1px solid #ad88402a;
}
#welcome .intro {
  flex:0 0 auto;
  text-align:center;
  padding:0 1px !important;
  position:relative;
  z-index:2;
}
#welcome .intro .eyebrow {
  margin:0;
  color:#e9c58a;
  font:600 clamp(9px,2.4vw,11px)/1.25 Georgia,'Times New Roman',serif;
  letter-spacing:.36em;
  text-transform:uppercase;
}
#welcome .intro .eyebrow::after {
  content:"✦";display:block;max-width:140px;margin:8px auto 0;
  font-size:17px;line-height:1;color:#e4c082;
  background:linear-gradient(90deg,transparent,#d8ab63 40%,transparent 40%,transparent 60%,#d8ab63 60%,transparent);
}
#welcome .intro h1 {
  margin:7px auto 0;
  max-width:420px;
  color:#fae7b9;
  font:500 clamp(31px,8.5vw,43px)/1.03 Georgia,'Times New Roman',serif;
  letter-spacing:-.015em;
  text-shadow:0 4px 14px #000c;
  text-wrap:balance;
}
#welcome .intro .muted {
  max-width:405px;
  margin:11px auto 0;
  color:#eee1c5;
  font:400 clamp(12px,3.5vw,15px)/1.4 Georgia,'Times New Roman',serif;
  text-wrap:balance;
  text-shadow:0 2px 7px #000d;
}
#welcome .heritage-content {
  flex:0 0 auto;
  position:relative;
  display:flex;
  flex-direction:column;
  gap:clamp(9px,1.4svh,15px);
  padding:0;
  margin:0;
}
#welcome .heritage-content::before {
  content:"";position:absolute;z-index:-1;
  left:2%;right:2%;top:4px;height:60%;
  border-radius:49% 49% 12px 12px / 20% 20% 12px 12px;
  border:1px solid #d8ad6077;
  background:radial-gradient(ellipse at 50% 40%,#4c503329,#05180e14 70%);
  box-shadow:inset 0 0 28px #0006,0 0 23px #d6ac3822;
  pointer-events:none;
}
#welcome .seal {
  flex:0 0 auto;
  isolation:isolate;
  height:clamp(234px,34svh,315px);
  margin:0 2px 0;
  border:1px solid #e7c17d7b;
  border-radius:46% 46% 19px 19px / 20% 20% 19px 19px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  overflow:hidden;
  background:
    radial-gradient(ellipse 80% 62% at 50% 45%,#66542e9c,transparent 90%),
    linear-gradient(180deg,#0e3024a8,#062018bd),
    var(--winefarm-estate-art) 50% 53% / cover no-repeat;
  box-shadow:inset 0 2px 0 #ffecaf43,inset 0 -28px 34px #00110ccc,0 12px 22px #0007;
}
#welcome .seal::before {
  content:"✦";position:absolute;z-index:6;
  top:5px;left:50%;transform:translateX(-50%);
  color:#f3d89a;opacity:.85;font-size:21px;text-shadow:0 1px 4px #000;
}
#welcome .seal::after {
  content:"";position:absolute;z-index:6;
  left:12px;right:12px;bottom:9px;height:1px;
  background:linear-gradient(90deg,transparent,#dfbc7c9e,transparent);
}
#welcome .envelope-photo-stage {
  position:relative;
  width:100%;
  max-width:445px;
  height:auto;
  aspect-ratio:620/325;
  margin:12px 0 0;
  filter:drop-shadow(0 13px 12px #000c);
}
#welcome .envelope-photo {
  position:absolute;inset:0;width:100%;height:100%;
  object-fit:cover;
}
#welcome .heritage-promises {
  flex:0 0 auto;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:0;
  width:100%;
  min-height:clamp(90px,12.3svh,113px);
  margin:0;
  padding:7px 5px 6px;
  border:1.5px solid #ba9458;
  border-radius:22px;
  background:linear-gradient(160deg,#13392be8,#031c14f3);
  box-shadow:inset 0 1px #f8d89965,0 3px 0 #382818,0 10px 20px #0007;
}
#welcome .heritage-promise {
  display:flex;flex-direction:column;
  align-items:center;justify-content:center;
  min-width:0;gap:5px;
  padding:2px 5px;text-align:center;
  color:#ecd3a0;
  border-right:1px solid #c2995561;
  pointer-events:none;
}
#welcome .heritage-promise:last-child {border-right:0}
#welcome .heritage-icon {
  flex:0 0 auto;
  display:grid;place-items:center;
  width:clamp(32px,7.5vw,42px);
  height:clamp(32px,7.5vw,42px);
  border:1px solid #cda7699e;
  border-radius:50%;
  box-shadow:inset 0 0 7px #ca9e4640,0 2px 5px #0008;
  color:#f1d28f;
}
#welcome .heritage-icon svg {display:block;width:78%;height:78%}
#welcome .heritage-promise-title {
  font:600 clamp(9px,2.4vw,12px)/1.23 Georgia,'Times New Roman',serif;
  letter-spacing:.015em;
  text-shadow:0 2px 5px #000e;
}
#welcome #open-pack {
  display:block;flex:0 0 auto;
  width:100%;
  min-height:clamp(55px,7svh,65px);
  border:1.5px solid #ffe5a9;
  border-radius:17px;
  padding:9px 18px;
  margin:0;
  font:600 clamp(19px,5vw,25px)/1.2 Georgia,'Times New Roman',serif;
  color:#1d2b1f;
  background:linear-gradient(180deg,#ffe8b5,#e5c083 60%,#c99449);
  box-shadow:inset 0 2px 0 #fff2d2a6,0 6px 15px #0009;
  text-shadow:0 1px #fff0be66;
}
#welcome #open-pack:not(:disabled):active {transform:translateY(1px);filter:brightness(.97)}
#welcome #open-pack:focus-visible {outline:3px solid #fff8c0;outline-offset:3px}
#welcome .heritage-assistance {
  flex:0 0 auto;
  min-height:20px;
  display:flex;align-items:center;justify-content:center;
  padding:0 6px;
  margin:0;
}
#welcome .heritage-assistance .helper,
#welcome #replay-hint {
  margin:0 auto;
  color:#c5c9b2;
  max-width:390px;
  font:11px/1.35 -apple-system,BlinkMacSystemFont,sans-serif;
  text-align:center;
}
#welcome .heritage-assistance [hidden] {display:none!important}
#welcome #replay-hint {color:#e7cf9e}
#welcome>.footer {
  flex:0 0 auto;
  margin:0 auto;
  max-width:400px;
  text-align:center;
  font:10px/1.4 -apple-system,BlinkMacSystemFont,sans-serif;
  color:#a6b8a2;
  text-shadow:0 1px 4px #00110b;
}
@media (max-height:750px) {
  #welcome:not([hidden]) {
    gap:8px;
    padding-top:12px;
    padding-bottom:max(10px,env(safe-area-inset-bottom));
  }
  #welcome .intro h1 {font-size:clamp(30px,8vw,36px);margin-top:5px}
  #welcome .intro .muted {margin-top:7px;font-size:12px}
  #welcome .seal {height:clamp(207px,32svh,250px)}
  #welcome .heritage-promises {min-height:86px;padding:5px 4px}
  #welcome .heritage-promise {gap:3px}
  #welcome #open-pack {min-height:51px;font-size:20px}
}
@media (max-width:360px) {
  #welcome:not([hidden]) {padding-left:10px;padding-right:10px}
  #welcome .heritage-promise-title {font-size:9px}
  #welcome .seal {height:225px}
}
@media(prefers-reduced-motion:reduce) {
  #welcome .seal.opening .envelope-photo-closed,
  #welcome .seal.opening .envelope-photo-open {transition:none}
}




/* Wine Farm photographic heritage v3 (mobile visual correction).
   Use the two original 620x325 assets as coherent full-frame imagery;
   there are no duplicated wax seals, overlaid leather triangles or fronts.
   The player's collectible content remains generated from the server grant. */
#welcome:not([hidden]) {
  background:
    linear-gradient(180deg,#071911d6 0%,#071e16a8 24%,#082b1e7a 45%,#04190fd8 83%,#04150fe7),
    var(--winefarm-estate-art) center center / cover no-repeat,#051912;
}
#welcome:not([hidden])::before {
  background:radial-gradient(ellipse 88% 40% at 70% 40%,#d89d4c26,transparent 86%);
}
#welcome .heritage-content::before {display:none}
#welcome #gift-stage {
  position:relative;
  isolation:isolate;
  border:0;
  border-radius:0;
  background:none;
  overflow:visible;
  box-shadow:none;
  height:clamp(222px,33svh,305px);
  margin:0;
}
#welcome #gift-stage::before,
#welcome #gift-stage::after {display:none}
#welcome .envelope-photo-stage {
  position:relative;
  width:100%;
  max-width:445px;
  height:auto;
  aspect-ratio:620 / 325;
  margin:0 auto;
  filter:drop-shadow(0 15px 16px #000b);
  overflow:visible;
}
#welcome .envelope-photo {
  position:absolute;
  inset:0;
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center center;
  border-radius:9px;
  transform-origin:50% 70%;
  -webkit-mask-image:radial-gradient(ellipse 71% 67% at center,#000 71%,transparent 100%);
  mask-image:radial-gradient(ellipse 71% 67% at center,#000 71%,transparent 100%);
}
#welcome .envelope-photo-closed {
  z-index:2;
  opacity:1;
  transform:translate3d(0,0,0);
}
#welcome .envelope-photo-open {
  z-index:3;
  opacity:0;
  object-position:center 66%;
  transform:translate3d(0,6px,0) scale(.96);
}
#welcome #gift-stage.opening .envelope-photo-closed {
  animation:wf-photo-close-v3 1.04s cubic-bezier(.25,.2,.35,1) both;
}
#welcome #gift-stage.opening .envelope-photo-open {
  animation:wf-photo-open-v3 1.05s cubic-bezier(.22,.7,.23,1) .30s both;
}
@keyframes wf-photo-close-v3 {
  0% {opacity:1;transform:scale(1);filter:brightness(1)}
  25% {opacity:1;transform:scale(1.015);filter:brightness(1.2)}
  55% {opacity:.82;transform:scale(1.01);filter:brightness(1.18)}
  100% {opacity:0;transform:scale(.985);filter:brightness(1.05)}
}
@keyframes wf-photo-open-v3 {
  0%,15% {opacity:0;transform:translateY(7px) scale(.96)}
  55% {opacity:.9;transform:translateY(0) scale(1)}
  100% {opacity:1;transform:translateY(0) scale(1)}
}
/* Bloom happens behind—not over—the original image. */
#welcome #gift-stage.opening {
  background:radial-gradient(ellipse 63% 39% at 50% 60%,#edb55a61,transparent 84%);
  animation:wf-heritage-bloom 2s ease both;
}
@keyframes wf-heritage-bloom {
  0% {filter:brightness(1)}
  60% {filter:brightness(1.1)}
  100% {filter:brightness(1)}
}
/* Collectible cards emerge from within a stable envelope rectangle. */
#welcome .wf-opening-cards {
  z-index:8;
  position:absolute;
  inset:-2% 2% 6%;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1.2%;
  pointer-events:none;
  perspective:850px;
}
#welcome .wf-opening-card {
  position:relative;
  z-index:8;
  box-sizing:border-box;
  flex:0 0 31.5%;
  min-width:0;
  height:clamp(162px,24svh,231px);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:5px;
  padding:11px 6px 9px;
  color:#fbecc8;
  text-align:center;
  border:1.5px solid #e0b76b;
  border-radius:10px;
  background:linear-gradient(165deg,#214b38 0%,#102d23 46%,#061b14 100%);
  box-shadow:inset 0 0 0 2px #584021,inset 0 0 0 4px #d4a55a7a,0 11px 20px #000b;
  opacity:0;
  transform:translateY(58px) scale(.64);
}
#welcome .wf-opening-card--region {
  flex-basis:34%;
  z-index:9;
  height:clamp(180px,27svh,258px);
  border-color:#fbe1a8;
}
#welcome .wf-opening-card::before {
  content:"";
  position:absolute;
  inset:5px;
  border:1px solid #c6a46679;
  border-radius:5px;
  pointer-events:none;
}
#welcome .wf-opening-card::after {
  content:"❦";
  position:absolute;
  bottom:3px;
  font-size:12px;
  color:#d7b16b;
  line-height:1;
}
#welcome .wf-opening-card-label {
  z-index:2;
  color:#f4d68f;
  flex-shrink:0;
  font:700 clamp(8px,2vw,10px)/1.1 -apple-system,BlinkMacSystemFont,sans-serif;
  letter-spacing:.055em;
}
#welcome .wf-opening-card-art {
  position:relative;
  flex:1 1 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:61px;
  border-radius:4px;
  background:radial-gradient(ellipse at center,#596039,#10291f 85%);
  overflow:hidden;
}
#welcome .wf-opening-card--region .wf-opening-card-art {
  background:
    linear-gradient(180deg,#0a201224,#091a10ab),
    var(--winefarm-estate-art) center / cover no-repeat,#2e543b;
}
#welcome .wf-region-sun {
  position:absolute;
  top:16%;
  right:12%;
  color:#fce3a1;
  font-size:24px;
  text-shadow:0 0 8px #ffe6ad;
}
#welcome .wf-opening-card-art .wf-botanical-svg {
  display:block;
  width:100%;
  height:100%;
  max-height:148px;
  filter:drop-shadow(0 3px 6px #0007);
}
#welcome .wf-opening-card-name {
  z-index:2;
  flex:0 0 auto;
  display:block;
  width:100%;
  min-height:2.1em;
  margin:0 0 7px;
  color:#fff0bf;
  font:600 clamp(11px,2.9vw,14px)/1.1 Georgia,'Times New Roman',serif;
  overflow-wrap:anywhere;
  white-space:normal;
  text-shadow:0 2px 5px #000d;
}
#welcome .wf-opening-card-ornament {display:none}
#welcome #gift-stage.cards-visible .wf-opening-card {
  animation:wf-collectible-v3 .90s cubic-bezier(.14,.84,.25,1) forwards;
}
#welcome #gift-stage.cards-visible .wf-opening-card:nth-child(2) {animation-delay:.07s}
#welcome #gift-stage.cards-visible .wf-opening-card:nth-child(3) {animation-delay:.14s}
@keyframes wf-collectible-v3 {
  0% {opacity:0;transform:translateY(68px) scale(.60) rotateY(-25deg)}
  58% {opacity:1;transform:translateY(-7px) scale(1.04) rotateY(0)}
  100% {opacity:1;transform:translateY(0) scale(1) rotateY(0)}
}
/* The receipt must be visually continuous with the approved background. */
body.onboarding-receipt .app {
  width:min(100%,520px);
  padding:0!important;
  background:#071b14;
}
body.onboarding-receipt .top {display:none}
#revealed:not([hidden]) {
  position:relative;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:clamp(10px,1.6svh,15px);
  width:100%;
  min-height:100dvh;
  padding:clamp(14px,2svh,24px) clamp(12px,4vw,22px)
          max(14px,env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg,#091b15a6 0%,#0820158c 38%,#071e15bf 76%,#06150fce),
    var(--winefarm-estate-art) center center / cover no-repeat,
    #113322;
}
#revealed .intro {text-align:center;padding:0}
#revealed .intro .eyebrow {color:#eac17e;letter-spacing:.22em;font-size:10px}
#revealed .intro h1 {
  font-size:clamp(30px,8.2vw,42px);
  line-height:1.02;
  text-shadow:0 3px 10px #000c;
}
#revealed .panel {
  margin:0;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
}
#revealed .region {
  padding:12px 14px;
  min-height:107px;
  border:1.5px solid #e2bb75;
  border-radius:15px;
  background:
    linear-gradient(90deg,#051a11ef 0%,#0e3828be 62%,#052116bc),
    var(--winefarm-estate-art) 50% 60% / cover no-repeat;
  box-shadow:inset 0 0 0 3px #bf9e5573,0 8px 16px #000a;
}
#revealed .region h2 {
  font:600 clamp(22px,6vw,31px)/1.1 Georgia,serif;
  color:#ffeac0;
}
#revealed .region .muted {color:#dfcbaa;font-size:13px}
#revealed .region-symbol {font-size:38px}
#revealed .ornament {margin:9px 0}
#revealed .panel>.eyebrow {font-size:9px;letter-spacing:.07em;color:#f3d99e}
#revealed .vines {gap:10px;margin:11px 0 15px}
#revealed .wf-earned-vine {
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:space-between;
  min-height:clamp(180px,28svh,274px);
  padding:11px 8px 13px;
  border:2px solid #d7b16f;
  border-radius:13px;
  background:radial-gradient(ellipse at 50% 29%,#4a603c 0%,#183e2e 50%,#062219 100%);
  box-shadow:inset 0 0 0 3px #624c2c,inset 0 0 0 5px #d5ae6898,0 10px 18px #0009;
}
#revealed .wf-earned-vine::before {
  content:"";
  position:absolute;
  inset:8px;
  border:1px solid #e1c68a75;
  border-radius:7px;
  pointer-events:none;
}
#revealed .wf-vine-eyebrow {
  font:700 9px/1.15 -apple-system,BlinkMacSystemFont,sans-serif;
  letter-spacing:.08em;
  color:#e8c98c;
}
#revealed .wf-vine-botanical {
  display:grid;
  place-items:center;
  width:100%;
  height:clamp(95px,17svh,158px);
}
#revealed .wf-vine-botanical .wf-botanical-svg {
  display:block;
  height:100%;
  width:min(95%,153px);
  filter:drop-shadow(0 4px 8px #000a);
}
#revealed .wf-earned-vine strong {
  font:600 clamp(18px,5.5vw,27px)/1.1 Georgia,serif;
  color:#fceac1;
  overflow-wrap:anywhere;
}
#revealed .wf-vine-meta {
  color:#e7d1a5;
  font:11px/1.25 -apple-system,BlinkMacSystemFont,sans-serif;
  margin-top:5px;
}
#revealed #to-home {
  min-height:56px;
  padding:12px 15px;
  border:1.5px solid #fff0c3;
  border-radius:17px;
  background:linear-gradient(180deg,#ffe7ae,#dab068);
  color:#132e21;
  font:600 clamp(20px,5.2vw,25px)/1.1 Georgia,serif;
  box-shadow:inset 0 2px #fff6d1a8,0 9px 17px #0008;
}
#revealed>.footer {
  color:#e8dbb8;
  font:11px/1.35 -apple-system,BlinkMacSystemFont,sans-serif;
  text-align:center;
}
@media(max-height:730px) {
  #welcome #gift-stage {height:clamp(205px,32svh,263px)}
  #welcome .wf-opening-card {height:clamp(157px,24svh,210px)}
  #welcome .wf-opening-card--region {height:clamp(175px,26svh,230px)}
  #revealed:not([hidden]) {gap:8px;padding-top:13px}
  #revealed .region {min-height:93px}
  #revealed .wf-earned-vine {min-height:176px}
  #revealed .wf-vine-botanical {height:clamp(79px,15svh,120px)}
}
@media(prefers-reduced-motion:reduce) {
  #welcome #gift-stage.opening,
  #welcome #gift-stage.opening .envelope-photo-closed,
  #welcome #gift-stage.opening .envelope-photo-open,
  #welcome #gift-stage.cards-visible .wf-opening-card {animation:none!important}
  #welcome #gift-stage.opening .envelope-photo-closed {opacity:0}
  #welcome #gift-stage.opening .envelope-photo-open {opacity:1;transform:none}
  #welcome #gift-stage.cards-visible .wf-opening-card {opacity:1;transform:none}
}


/* Wine Farm envelope visual variety v1: isolated to the existing gift scene. */
#welcome .wf-opening-card-art .wf-varying-landscape,
#welcome .wf-opening-card-art .wf-varying-grape {
  display:block;
  width:100%;
  height:100%;
  max-height:none;
  object-fit:cover;
  object-position:center;
  border-radius:3px;
}
#welcome .wf-opening-card--region .wf-opening-card-art {
  background:#315442;
}
#welcome .wf-opening-card--region .wf-varying-landscape {
  object-position:center 45%;
}
#welcome .wf-opening-card-name {
  font-size:clamp(10px,2.75vw,14px);
  line-height:1.13;
  overflow-wrap:break-word;
  word-break:normal;
  hyphens:manual;
  text-wrap:balance;
  max-width:100%;
}
#welcome .wf-opening-card-name--long {
  font-size:clamp(10px,2.15vw,12px);
  letter-spacing:-.035em;
}
#welcome .wf-opening-card-name--xlong {
  font-size:clamp(9px,1.9vw,11px);
  letter-spacing:-.04em;
}
#welcome .wf-opening-card-name--regionlong {
  font-size:clamp(10px,2.35vw,12.5px);
  line-height:1.08;
  overflow-wrap:anywhere;
}
#welcome .wf-opening-card[data-color-group="WHITE"] {
  background:linear-gradient(165deg,#28503b 0%,#133429 46%,#071e15 100%);
}
#welcome .wf-opening-card[data-color-group="RED"] {
  background:linear-gradient(165deg,#3c3540 0%,#242930 46%,#10231b 100%);
}
#welcome .wf-opening-card[data-color-group="AROMATIC"] {
  background:linear-gradient(165deg,#4d4731 0%,#2f3829 46%,#12231b 100%);
}
#welcome .wf-opening-card[data-color-group="NEUTRAL"] {
  background:linear-gradient(165deg,#244b38 0%,#122d26 46%,#081e16 100%);
}
.wf-receipt-grape-art {
  display:block;
  width:100%;
  height:100%;
  max-height:160px;
  object-fit:contain;
  border-radius:5px;
}

/* 06.11.2026: real vine pictures (painted variety art / vine generator) stay inside their frame. */
#revealed .wf-vine-botanical{overflow:hidden}
#revealed .wf-vine-botanical .wf-receipt-grape-art.wf-real-grape{height:100%;max-height:100%;width:auto;max-width:92%;object-fit:contain;filter:drop-shadow(0 4px 8px #000a)}
