:root{ --sky:#ffe7a3; --grass1:#8be06f; --grass2:#4cb453; --pipe:#2a8a3b; --pipe-dot:#6acd68; --pipe-outline:#1e5e2a; }
:root{ --ui-scale: 1; }

html,body{margin:0;height:100%;background:#000000;font-family:system-ui,Segoe UI,Roboto,Helvetica,Arial;touch-action:manipulation;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}
#wrap{display:flex;align-items:center;justify-content:center;height:100%;position:relative;z-index:1;touch-action:none}
canvas{background:#000;touch-action:none;display:block;position:relative;z-index:1}
/* Crash screen shake — applied to the canvas for ~280ms */
@keyframes fgShakeAnim{
  0%  {transform:translate(0,0)}
  12% {transform:translate(-7px,-5px)}
  25% {transform:translate(7px,4px)}
  37% {transform:translate(-6px,6px)}
  50% {transform:translate(6px,-4px)}
  62% {transform:translate(-5px,5px)}
  75% {transform:translate(5px,-5px)}
  87% {transform:translate(-4px,3px)}
  100%{transform:translate(0,0)}
}
canvas.fgShake{animation:fgShakeAnim 0.28s ease-out;}
canvas.playing{background:linear-gradient(var(--sky),var(--sky) 65%, var(--grass1) 65%, var(--grass2) 100%);}
.gardenNameFeedback{
  position:fixed;
  left:50%;
  top:42%;
  transform:translate(-50%,-50%) scale(.96);
  z-index:100000;
  pointer-events:none;
  opacity:0;
  transition:opacity .2s ease, transform .2s ease;
  width:min(88vw,520px);
  padding:24px 26px;
  border-radius:22px;
  background:rgba(0,0,0,.34);
  box-shadow:0 12px 34px rgba(0,0,0,.22);
  text-align:center;
  font-family:"Luckiest Guy", system-ui, sans-serif;
  color:#fff;
}
.gardenNameFeedback.show{
  opacity:1;
  transform:translate(-50%,-50%) scale(1);
}
.gardenNameFeedbackText{
  font-size:clamp(34px,9vw,72px);
  line-height:.98;
  text-shadow:0 3px 10px rgba(0,0,0,.45);
}
.gardenNameFeedbackName{
  margin-top:18px;
  font-size:clamp(30px,8vw,64px);
  line-height:1;
  color:#ffe15c;
  text-shadow:0 3px 10px rgba(0,0,0,.38);
}
.hud{position:fixed;inset:0;pointer-events:none;display:flex;align-items:center;justify-content:center;color:#fff;
     text-shadow:0 2px 6px rgba(0,0,0,.45);text-align:center;padding:16px}
.topbar{position:fixed;left:0;right:0;top:0;display:flex;justify-content:space-between;gap:8px;padding:10px 12px;
        color:#fff;font-weight:700;text-shadow:0 2px 6px rgba(0,0,0,.45);pointer-events:none;flex-wrap:wrap}
.chips{display:flex;gap:8px;flex-wrap:wrap}
.chip{background:rgba(0,0,0,.35);border-radius:14px;padding:6px 10px}
.btn{pointer-events:auto;display:inline-block;margin-top:12px;padding:10px 16px;border-radius:14px;font-weight:800;
     background:#ffe15c;color:#2a1a00;box-shadow:0 6px 0 #c7b03e;user-select:none}
.btn:active{transform:translateY(2px);box-shadow:0 4px 0 #c7b03e}
.modal{position:fixed;inset:0;background:rgba(0,0,0,.55);display:none;align-items:center;justify-content:center}
.card{background:#fff;color:#222;max-width:320px;border-radius:14px;padding:16px;box-shadow:0 10px 30px rgba(0,0,0,.4);text-align:center}
.progress{height:8px;background:#eee;border-radius:999px;overflow:hidden;margin-top:8px}
.bar{height:8px;background:#0bbf5c;width:0%}

.hud-top{position:fixed;inset:0 0 auto 0;display:flex;justify-content:space-between;align-items:flex-start;padding:8px 12px;pointer-events:none;z-index:9999}
@supports (-webkit-touch-callout: none){
  .hud-top{top:calc(env(safe-area-inset-top, 0px) + 20px);}
}
@supports not (-webkit-touch-callout: none){
  .hud-top{top:-8px;}
}
.scoreHud{
  font-family:"Luckiest Guy", system-ui, sans-serif;
  font-size:calc(54px * var(--ui-scale));
  line-height:1;
  color:#fff;
  letter-spacing:1px;
  text-shadow:0 4px 18px rgba(0,0,0,.35);
  pointer-events:none;
  transform:translateY(calc(8px * var(--ui-scale)));
}
.scoreBig{font-family:"Luckiest Guy", system-ui, sans-serif;font-size:calc(54px * var(--ui-scale));line-height:1;color:#fff;letter-spacing:1px;text-shadow:0 4px 18px rgba(0,0,0,.35);}
.gnickels{display:flex;align-items:center;gap:calc(10px * var(--ui-scale));color:#fff;text-shadow:0 4px 18px rgba(0,0,0,.35);transform:translateY(calc(16px * var(--ui-scale)))}
.gnickels img{height:calc( 52px * var(--ui-scale));width:auto;image-rendering:pixelated;filter: drop-shadow(0 2px 8px rgba(0,0,0,.45));}
.gnickels .mul{font-family:"Luckiest Guy", system-ui, sans-serif;font-size:calc(54px * var(--ui-scale));line-height:1;opacity:.95}
#gnickelsHUD{
  position:fixed;
  left:12px;
  top:60px;
  pointer-events:none;
}
.lives{position:relative;display:flex;align-items:center;gap:calc(10px * var(--ui-scale));color:#fff;text-shadow:0 4px 18px rgba(0,0,0,.35)}
.lives img{height:calc( 91px * var(--ui-scale) * 0.8);width:auto;image-rendering:pixelated;filter: drop-shadow(0 2px 8px rgba(0,0,0,.45));}
.lives .mul{font-family:"Luckiest Guy", system-ui, sans-serif;font-size:calc(54px * var(--ui-scale));line-height:1;opacity:.95}
#livesTimer{
  position:absolute;
  top:100%;
  right:0;
  margin-top:-8px;
  white-space:nowrap;
  font-family:"Luckiest Guy", system-ui, sans-serif;
  font-size:clamp(12px,2.6vw,18px);
  line-height:1;
  color:#fff;
  text-shadow:0 4px 12px rgba(0,0,0,.35);
  opacity:.9;
  pointer-events:none;
}
#watchForEntries, #refillBtn, #refillBtn2, #attempts, #entries, #monthLbl { display:none !important; }

.bigPlayOverlay{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  pointer-events:auto;
  z-index:9998;
  cursor:pointer;
  background: #000;
  overflow: hidden;
}
.bigPlayOverlay h1{
  position:absolute;
  font-family:"Luckiest Guy", system-ui, sans-serif;
  font-size:clamp(48px,12vw,140px);
  color:#fff;
  letter-spacing:1px;
  text-shadow:0 12px 28px rgba(0,0,0,.45);
  margin:0;
  opacity:.95;
  cursor:pointer;
}
.splashStage{
  position:absolute;
  inset:0;
  container-type:size;
  display:flex;
  align-items:center;
  justify-content:center;
}
.splashFrame{
  --splash-overhang: 0.085;
  position:relative;
  aspect-ratio: 1668 / 2590.98;
  height: min(100cqh, calc(100cqw * 2590.98 / 1668));
  width:auto;
  flex:0 0 auto;
}
.splashArt{
  position:absolute;
  left:0;
  right:0;
  top:0;
  height: calc(100% / (1 + var(--splash-overhang)));
  background: #000 url("/assets/Flappy_Gnome%20splash-DA6WAo_y.png") center / 100% 100% no-repeat;
}
.splashInstallBtn{
  position:absolute;
  top:0.2%;
  left:2.5%;
  width:28%;
  min-height:44px;
  padding:0;
  border:0;
  background:none;
  cursor:pointer;
}
.splashInstallBtn img{
  display:block;
  width:100%;
  height:auto;
  pointer-events:none;
}
@media (display-mode: standalone){
  .splashInstallBtn{display:none;}
}
.splashMainActions{
  position:absolute;
  left:3%;
  right:3%;
  bottom:8%;
  transform:none;
  display:flex;
  gap:2%;
  align-items:flex-end;
  justify-content:space-between;
  pointer-events:none;
  width:auto;
}
.bigPlayOverlay.mode-open .splashMainActions,
.bigPlayOverlay.mode-open .splashBottomBar{
  display:none;
}
/* Image-based main action buttons (PLAY + GNORMAN'S GNOOK) */
.splashImgBtn{
  border:0;
  background:transparent;
  padding:0;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  display:block;
  position:relative;
  flex:0 0 48%;
  width:48%;
  min-width:0;
  overflow:hidden;
  filter:drop-shadow(0 4px 8px rgba(0,0,0,.45));
  transform:none;
  pointer-events:auto;
}
.playButton.splashImgBtn{ aspect-ratio: 1.4885; }
.gnookButton.splashImgBtn{ aspect-ratio: 1.5967; }
.splashImgBtn:active{ transform:translateY(2px); }
.splashBtnImgMain{
  position:absolute;
  display:block;
  margin:0;
  max-width:none;
}
.playButton .splashBtnImgMain{
  width:116.24%;
  height:259.5%;
  left:-6.47%;
  top:-88.03%;
}
.gnookButton .splashBtnImgMain{
  width:112.91%;
  height:270.4%;
  left:-6.18%;
  top:-86.27%;
}
.splashModePicker{
  position:absolute;
  left:50%;
  bottom:22vh;
  transform:translateX(-50%);
  display:none;
  flex-direction:column;
  gap:10px;
  align-items:center;
  pointer-events:auto;
}
.splashModePicker.open{display:flex}
.splashModeActions{
  display:flex;
  gap:44px;
  align-items:center;
  justify-content:center;
}
.splashModeBig{
  font-family:"Luckiest Guy", system-ui, sans-serif;
  font-size:clamp(42px,10.5vw,120px);
  color:#fff;
  background:transparent;
  border:0;
  letter-spacing:1px;
  text-shadow:0 12px 28px rgba(0,0,0,.45);
  cursor:pointer;
  padding:0;
}
.splashModeBack{
  margin-top:18px;
  font-family:"Luckiest Guy", system-ui, sans-serif;
  font-size:clamp(22px,5vw,44px);
  color:#fff;
  background:transparent;
  border:0;
  letter-spacing:1px;
  text-shadow:0 12px 28px rgba(0,0,0,.45);
  cursor:pointer;
}

.splashBottomBar{
  position:absolute;
  left:3%;
  right:3%;
  top:100%;
  bottom:auto;
  height:0;
  display:flex;
  flex-wrap:nowrap;
  justify-content:space-between;
  align-items:flex-start;
  pointer-events:none;
  padding:0;
}
.splashBtn{
  border:0;
  background:transparent;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.splashIconBtn{
  position:relative;
  padding:0;
  display:block;
  overflow:hidden;
  pointer-events:auto;
  transform:translateY(-50%);
  filter:drop-shadow(0 4px 8px rgba(0,0,0,.45));
}
.splashIconImg{
  position:absolute;
  display:block;
  margin:0;
  max-width:none;
}
.splashBottomBar [data-action="howto"]{
  width:18%;
  aspect-ratio:0.952;
}
.splashBottomBar [data-action="howto"] .splashIconImg{
  width:107.56%;
  height:102.4%;
  left:-4.21%;
  top:-2.4%;
}
.splashBottomBar [data-action="shrubhub"]{
  width:30%;
  aspect-ratio:1.7415;
}
.splashBottomBar [data-action="shrubhub"] .splashIconImg{
  width:119.35%;
  height:138.5%;
  left:-10.87%;
  top:-19.63%;
}
.splashBottomBar [data-action="leaderboard"]{
  width:28%;
  aspect-ratio:2.6953;
}
.splashBottomBar [data-action="leaderboard"] .splashIconImg{
  width:103.69%;
  height:110%;
  left:-1.85%;
  top:-4.99%;
}
.splashBottomBar .splashBtn:active{
  transform:translateY(calc(-50% + 2px));
}

/* "Update available" nag button — hidden by default, shown only when
   updateCheck.js confirms a newer build is published. Uses the exact same
   bottom-right position/size/style as the shared BACK button elsewhere. */
.splashUpdateBtn{
  display:none;
  white-space:nowrap;
}
.splashUpdateBtn.show{
  display:block;
}

.splashModal{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.6);
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
}
.splashModal.open{display:flex}
.splashCard{
  background:#fff;
  color:#222;
  max-width:360px;
  width:min(90vw,360px);
  border-radius:14px;
  padding:16px;
  box-shadow:0 10px 30px rgba(0,0,0,.4);
}
.splashCardHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:8px;
}
.splashTitle{margin:0;font-size:20px;line-height:1.2}
.splashClose{
  background:transparent;
  border:0;
  font-size:24px;
  line-height:1;
  cursor:pointer;
  color:#333;
}
.splashBody p{margin:0 0 10px}
.splashBody p:last-child{margin-bottom:0}

.dailyCounter{
  position:fixed;
  left:12px;
  bottom:10px;
  font-family:"Luckiest Guy", system-ui, sans-serif;
  font-size:clamp(28px,9vw,56px);
  color:#fff;
  letter-spacing:1px;
  text-shadow:0 10px 24px rgba(0,0,0,.45);
  z-index:9999;
  pointer-events:none;
  display:block;
}

#gnookScreen{
  position:fixed;
  inset:0;
  z-index:9999;
  background:url('/assets/gnorman_nook_bg-CaIIvtLt.png') center center / cover no-repeat;
  color:#fff;
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:18px 20px 28px;
}
.gnookHeader{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.gnookTitle{
  font-family:"Luckiest Guy", system-ui, sans-serif;
  font-size:clamp(34px,8vw,64px);
  text-shadow:0 10px 24px rgba(0,0,0,.45);
}
/* ── Shared back button style — all screens use this ── */
.gnookReturn,
.privacyReturn,
#howToPlayPractice,
#howToPlayBack,
.leaderboardRefresh,
.leaderboardBack,
.shrubBack,
.splashUpdateBtn{
  position:fixed;
  right:12px;
  bottom:16px;
  background:none;
  border:0;
  color:#fff;
  font-family:"Luckiest Guy", system-ui, sans-serif;
  font-size:clamp(28px,7vw,52px);
  line-height:1;
  cursor:pointer;
  text-shadow:0 10px 24px rgba(0,0,0,.45);
  -webkit-tap-highlight-color:transparent;
  z-index:10;
  transform:none;
}

.gnookReturn{
  transform:translateY(-7px);
}
.gnookContent{
  margin-top:28vh;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:22px;
  text-align:left;
  width:100%;
  padding-left:24px;
  flex:1;
}
.gnookTopLeft{
  align-self:flex-start;
  margin-left:0;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.gnookBottomLeft{
  position:absolute;
  left:16px;
  bottom:16px;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:6px;
}
.gnookMerchLogo{
  height:20px;
  width:auto;
  image-rendering:auto;
  margin:0 4px;
  vertical-align:middle;
  filter: invert(0);
}
.gnookMerchLabel{
  font-family:"Luckiest Guy", system-ui, sans-serif;
  font-size:clamp(18px,5vw,24px);
  vertical-align:middle;
}
.gnookTotal{
  font-family:"Luckiest Guy", system-ui, sans-serif;
  font-size:clamp(22px,5.5vw,38px);
  text-shadow:0 10px 24px rgba(0,0,0,.45);
}
.gnookBalance{
  display:inline-flex;
  align-items:center;
  gap:10px;
  font-family:"Luckiest Guy", system-ui, sans-serif;
  font-size:clamp(36px,9vw,64px);
  text-shadow:0 10px 24px rgba(0,0,0,.45);
}
.gnookBalanceX{
  margin-left:-4px;
  display:inline-block;
  transform:translateY(6px);
}
#gnookTotalVal{
  display:inline-block;
  transform:translateY(6px);
}
.gnookCoin{
  height:clamp(48px,10vw,72px);
  width:auto;
  image-rendering:pixelated;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.45));
}
/* Gnook backgrounds/characters buttons */
.gnookBtnIcon{
  height:32px;
  width:32px;
  border-radius:4px;
  object-fit:cover;
  object-position:center;
  vertical-align:middle;
  margin-right:6px;
  image-rendering:pixelated;
  flex-shrink:0;
}
.gnookBtnIconSprite{
  border-radius:0;
  object-fit:contain;
}
.gnookBgBtn{
  margin-top:14px;
  background:rgba(255,255,255,0.88);
  border:none;border-radius:12px;
  padding:14px 24px;
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(18px,5vw,24px);
  display:flex;
  align-items:center;
  width:min(88vw,380px);
  text-align:left;
  color:#2a1a00;
  letter-spacing:1px;
  cursor:pointer;
  box-shadow:0 4px 12px rgba(0,0,0,.15);
  width:min(88vw,380px);
  text-align:left;
  -webkit-tap-highlight-color:transparent;
}

/* Backgrounds screen */
#bgScreen, #charScreen{
  position:fixed;inset:0;z-index:10000;
  background:linear-gradient(var(--sky),var(--sky) 65%, var(--grass1) 65%, var(--grass2) 100%);
  display:flex;flex-direction:column;
  font-family:"Luckiest Guy",system-ui,sans-serif;
}
.bgScreenHeader{
  padding:18px 20px 10px;
  flex-shrink:0;
}
@supports (-webkit-touch-callout: none){
  .bgScreenHeader{ padding-top:54px; }
}
.bgScreenTitle{
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(28px,7vw,52px);
  color:#fff;
  text-shadow:0 6px 18px rgba(0,0,0,.4);
}
.bgScreenList{
  flex:1;overflow-y:auto;
  padding:0 14px 90px;
  display:flex;flex-direction:column;gap:10px;
  -webkit-overflow-scrolling:touch;
  scroll-behavior:smooth;
}
.bgCard{
  background:#fff;
  border-radius:16px;
  display:flex;flex-direction:row;
  box-shadow:0 4px 16px rgba(0,0,0,.18);
  border:3px solid transparent;
  height:130px;
}
.bgCardActive{ border-color:#f7c948; }
/* Preview sits in its own rounded-left container so overflow:hidden
   clips only the image, not the text */
.bgPreviewWrap{
  width:45%;flex-shrink:0;
  border-radius:13px 0 0 13px;
  overflow:hidden;
  position:relative;
  pointer-events:none; /* let touches pass through so the list scrolls */
}
.bgPreview{
  width:100%;height:100%;
  display:block;
  image-rendering:pixelated;
  object-fit:cover;
  pointer-events:none;
}
.bgCardInfo{
  flex:1;
  padding:10px 12px 10px;
  display:flex;flex-direction:column;justify-content:flex-start;gap:4px;
  min-width:0;
}
.bgCardName{
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(16px,4.5vw,22px);
  line-height:1.2;
  color:#2a1a00;letter-spacing:.5px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.bgCardFree,.bgCardBadge{
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(13px,3.5vw,16px);
  color:#2a8a3b;letter-spacing:1px;
}
.bgCardCost{
  display:flex;align-items:center;gap:5px;
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(13px,3.5vw,16px);
  color:#7a5000;
}
.bgCardCoin{height:18px;width:auto;image-rendering:pixelated;}
.bgCardSelect{
  background:#2a8a3b;border:none;border-radius:8px;
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(13px,3.5vw,16px);color:#fff;
  padding:6px 14px;cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.bgCardBuy{
  background:#f7c948;border:none;border-radius:8px;
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(13px,3.5vw,16px);color:#2a1a00;
  padding:6px 14px;cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.bgCardBuy:disabled,.bgCardBuyDisabled{opacity:.45;cursor:default;}
.bgCardActions{display:flex;gap:6px;align-items:center;flex-wrap:wrap;}
/* IAP price button */
.bgCardIap{
  background:#4a90d9;border:none;border-radius:8px;
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(13px,3.5vw,16px);color:#fff;
  padding:6px 12px;cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
/* Score-gate label */
.bgScoreReq{
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(11px,3vw,13px);
  color:#b56a00;
  margin-bottom:4px;
  letter-spacing:.3px;
}
/* AR bundle subtitle */
.bgBundleNote{
  font-size:clamp(10px,2.8vw,12px);
  color:#555;
  margin-bottom:3px;
  font-style:italic;
}

/* ── Character screen ─────────────────────────────────────────────────────── */
.charPreviewImg{
  width:100%;height:100%;
  object-fit:contain;
  image-rendering:pixelated;
  padding:8px;
  box-sizing:border-box;
}

.bgScreenFooter{
  position:fixed;bottom:0;left:0;right:0;
  height:80px;
  /* mirrors the screen's grass gradient so cards tuck cleanly behind it */
  background:linear-gradient(to bottom, transparent 0%, var(--grass1,#8be06f) 35%, var(--grass2,#4cb453) 100%);
  display:flex;align-items:flex-end;justify-content:flex-end;
  padding:0 16px 14px;
  pointer-events:none;
}
.bgScreenBack{
  pointer-events:all;
  background:none;border:0;
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(28px,7vw,52px);line-height:1;
  color:#fff;text-shadow:0 10px 24px rgba(0,0,0,.45);
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}

.gnookComingSoon{
  background:rgba(255,255,255,0.88);
  border-radius:16px;
  padding:20px 18px;
  margin-top:12px;
  max-width:min(88vw,380px);
  box-shadow:0 8px 24px rgba(0,0,0,.2);
}
.gnookComingSoonTitle{
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(18px,5vw,26px);
  color:#2a1a00;
  letter-spacing:1px;
  margin-bottom:12px;
  line-height:1.2;
}
.gnookComingSoonText{
  font-family:system-ui,sans-serif;
  font-size:clamp(12px,3.2vw,15px);
  color:#333;
  line-height:1.55;
  margin:0 0 8px;
}
.gnookComingSoonNote{
  margin-top:10px;
  font-weight:600;
  color:#555;
}
.gnookDailyCap{
  position:absolute;
  left:12px;
  bottom:16px;
  display:flex;
  align-items:center;
  justify-content:center;
  width:96px;
  height:86px;
  text-align:center;
  min-width:96px;
}
.gnookDailyCap::before{
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  width:86px;
  height:86px;
  background:url("/assets/gnickel-BYnW2yBQ.png") center/contain no-repeat;
  opacity:0.9;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.35));
  pointer-events:none;
  transform:translate(-50%,-50%) translateY(-2px);
}

#leaderboardScreen{
  position:fixed;
  inset:0;
  z-index:10002;
  background:#1a0e05;
  color:#fff;
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:18px 20px 0;
  overflow:hidden;
}
.leaderboardBgImg{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center top;
  z-index:0;
  pointer-events:none;
}
#leaderboardScreen .leaderboardList{
  position:relative;
  z-index:2;
}
.leaderboardPanel{
  position:relative;
  z-index:1;
  width:min(92vw,540px);
  margin-top:12.2vh;
}
.leaderboardHeader{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.leaderboardTop{
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  margin-bottom:0;
}
.leaderboardTabs{
  display:flex;
  align-items:flex-end;
  justify-content:center;
  gap:9px;
  width:100%;
  position:relative;
  overflow:hidden;
}
.leaderboardPanel{
  --active-tint-strong:rgba(255,196,64,1);
  --active-tint-mid:rgba(255,196,64,.4);
  --active-border:rgba(255,224,150,.95);
  --row-highlight-bg:rgba(255,225,92,.28);
  --row-highlight-border:rgba(255,225,92,.82);
}
.leaderboardPanel[data-active-type="monthly"]{
  --active-tint-strong:rgba(41,178,255,1);
  --active-tint-mid:rgba(41,178,255,.4);
  --active-border:rgba(180,232,255,.95);
  --row-highlight-bg:rgba(41,178,255,.28);
  --row-highlight-border:rgba(180,232,255,.85);
}
.leaderboardPanel[data-active-type="weekly"]{
  --active-tint-strong:rgba(255,67,86,1);
  --active-tint-mid:rgba(255,67,86,.4);
  --active-border:rgba(255,196,203,.95);
  --row-highlight-bg:rgba(255,67,86,.28);
  --row-highlight-border:rgba(255,196,203,.85);
}
.leaderboardGlass{
  position:absolute;
  top:0;
  left:0;
  pointer-events:none;
  z-index:1;
  overflow:visible;
  display:block;
}
.leaderboardGlassPath{
  stroke-width:2px;
}
.leaderboardTab{
  --tab-top:rgba(255,205,90,1);
  --tab-bottom:rgba(255,187,45,1);
  --tab-border:rgba(255,224,150,.9);
  font-family:"Luckiest Guy", system-ui, sans-serif;
  font-size:clamp(15px,3.9vw,22px);
  color:#fff8e8;
  background:linear-gradient(to bottom, var(--tab-top) 0%, var(--tab-bottom) 100%);
  border:2px solid var(--tab-border);
  border-bottom:none;
  border-radius:10px 10px 0 0;
  padding:8px 15px 11px;
  line-height:1;
  pointer-events:auto;
  white-space:nowrap;
  text-shadow:0 1px 4px rgba(0,0,0,.68);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.16),
    inset 0 -4px 6px rgba(0,0,0,.08);
  opacity:1;
  transform:translateY(6px);
  position:relative;
  z-index:1;
  -webkit-tap-highlight-color:transparent;
}
.leaderboardTabMonth{
  --tab-top:rgba(80,205,255,1);
  --tab-bottom:rgba(20,150,224,1);
  --tab-border:rgba(180,232,255,.9);
}
.leaderboardTabWeek{
  --tab-top:rgba(255,105,120,1);
  --tab-bottom:rgba(214,40,56,1);
  --tab-border:rgba(255,196,203,.9);
}
.leaderboardTabInner{
  display:block;
}
.leaderboardTab.active{
  opacity:1;
  transform:translateY(0);
  z-index:4;
  background:transparent;
  border-color:transparent;
  box-shadow:none;
}
.leaderboardTabSubtitle{
  display:block;
  margin-top:2px;
  font-size:clamp(9px,2.3vw,12px);
  letter-spacing:.04em;
  opacity:.9;
  text-shadow:0 1px 4px rgba(0,0,0,.65);
  white-space:normal;
  max-width:clamp(90px,30vw,150px);
  margin-left:auto;
  margin-right:auto;
  line-height:1.15;
}
.leaderboardTabSubtitle[hidden]{
  display:none;
}
.leaderboardRefresh{
  left:calc(12px + var(--safe-left));
  right:auto;
  bottom:calc(12px + var(--safe-bottom));
}
.leaderboardRefresh:disabled{opacity:.55;}
.leaderboardBack{}
.leaderboardList{
  position:relative;
  z-index:2;
}
.leaderboardRows{
  max-height:63vh;
  overflow-y:auto;
  padding:14px 8px 72px;
  -webkit-mask-image:linear-gradient(to bottom, #000 0%, #000 calc(100% - 72px), transparent 100%);
  mask-image:linear-gradient(to bottom, #000 0%, #000 calc(100% - 72px), transparent 100%);
}
.leaderboardRow{
  position:relative;
  z-index:1;
  display:flex;
  align-items:center;
  gap:7px;
  background:rgba(0,0,0,.25);
  border-radius:13px;
  padding:7px 12px;
  box-shadow:0 10px 24px rgba(0,0,0,.25);
  margin-bottom:6px;
}
.leaderboardRow.currentPlayer{
  background:var(--row-highlight-bg);
  outline:2px solid var(--row-highlight-border);
}
.leaderboardRow--appended{
  margin-top:16px;
  padding-top:16px;
  border-top:2px dashed rgba(255,255,255,.35);
}
/* Pinned duplicate of the current player's real row — shown only while it's
   scrolled out of view, at the bottom (browsing better ranks above) or top
   (browsing worse ranks below), so your own score is always visible. Its
   "top" position is set inline by JS every scroll frame so the handoff with
   the real row is pixel-continuous instead of a hard cut. */
.leaderboardStickySelf{
  display:none;
  position:absolute;
  left:8px;
  right:8px;
  z-index:5;
  pointer-events:none;
}
.leaderboardStickySelf.visible{
  display:block;
}
.leaderboardStickySelf .leaderboardRow{
  margin-bottom:0;
}
.leaderboardRank{
  width:39px;
  flex-shrink:0;
  font-family:"Luckiest Guy", system-ui, sans-serif;
  font-size:clamp(17px,4.3vw,26px);
  color:#ffe15c;
  text-shadow:0 4px 12px rgba(0,0,0,.45);
}
.leaderboardAvatar{
  height:40px;
  width:40px;
  border-radius:9px;
  image-rendering:pixelated;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.35));
  flex-shrink:0;
  background:rgba(0,0,0,.16);
}
.leaderboardName{
  font-family:"Luckiest Guy", system-ui, sans-serif;
  font-size:clamp(18px,4.5vw,29px);
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.leaderboardScore{
  margin-left:auto;
  font-family:"Luckiest Guy", system-ui, sans-serif;
  font-size:clamp(18px,4.5vw,29px);
}
.leaderboardState{
  background:rgba(0,0,0,.28);
  border-radius:14px;
  padding:16px 18px;
  font-family:"Luckiest Guy", system-ui, sans-serif;
  font-size:clamp(18px,4.8vw,28px);
  text-align:center;
  text-shadow:0 8px 20px rgba(0,0,0,.45);
}
.gnookDailyText{
  font-family:"Luckiest Guy", system-ui, sans-serif;
  font-size:clamp(18px,4.8vw,26px);
  text-shadow:0 10px 24px rgba(0,0,0,.45);
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.gnookDailyCoin{
  height:1.62em;
  width:auto;
  image-rendering:pixelated;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.35));
  transform:translateY(-2px);
}
.gnookDailyValue{
  position:relative;
  z-index:1;
  font-family:"Luckiest Guy", system-ui, sans-serif;
  font-size:clamp(22px,5.5vw,36px);
  text-shadow:0 10px 24px rgba(0,0,0,.45);
  transform:translateY(1px);
}
.gnookHiddenGnickel{
  position:absolute;
  z-index:5;
  padding:0;
  border:0;
  background:transparent;
  cursor:pointer;
  transform:translate(-50%, -50%);
  -webkit-tap-highlight-color:transparent;
  animation:gnookHiddenGnickelPulse 3.6s ease-in-out infinite;
}
.gnookHiddenGnickelImg{
  height:clamp(28px,6vw,40px);
  width:auto;
  image-rendering:pixelated;
  filter:drop-shadow(0 2px 6px rgba(0,0,0,.5));
  display:block;
  opacity:0.88;
}
.gnookHiddenGnickel:active .gnookHiddenGnickelImg{
  transform:scale(0.92);
}
@keyframes gnookHiddenGnickelPulse{
  0%, 100%{ filter:drop-shadow(0 2px 6px rgba(0,0,0,.5)); opacity:0.88; }
  50%{ filter:drop-shadow(0 2px 10px rgba(255,220,80,.35)); opacity:1; }
}
.gnookEntryBtn{
  font-family:"Luckiest Guy", system-ui, sans-serif;
  font-size:clamp(18px,4.5vw,26px);
  padding:10px 16px;
  border-radius:12px;
  border:0;
  color:#fff;
  background:rgba(0,0,0,.35);
  text-shadow:0 10px 24px rgba(0,0,0,.45);
  box-shadow:0 6px 0 rgba(0,0,0,.25);
  cursor:pointer;
}
.gnookEntryBtn:active{transform:translateY(2px);box-shadow:0 4px 0 rgba(0,0,0,.25)}

#tapPrompt{
  position:fixed;
  left:50%;
  top:58%;
  transform:translate(-50%, -50%);
  font-family:"Luckiest Guy", system-ui, sans-serif;
  font-size:clamp(28px,7vw,64px);
  color:#fff;
  letter-spacing:1px;
  text-shadow:0 10px 24px rgba(0,0,0,.45);
  z-index:9999;
  pointer-events:none;
  animation:tapPulse 1.4s ease-in-out infinite;
}
@keyframes tapPulse{
  0%{opacity:.15;transform:translate(-50%,-50%) scale(0.98)}
  50%{opacity:1;transform:translate(-50%,-50%) scale(1)}
  100%{opacity:.15;transform:translate(-50%,-50%) scale(0.98)}
}

/* Force shadow on the big left score to match lives */
#scoreBig {
  text-shadow: 0 4px 18px rgba(0,0,0,.35) !important;
}

/* Privacy / Rules screen (also used by the hidden Developer Mode screen) */
#privacyScreen,
#devModeScreen{
  position:fixed;inset:0;z-index:10001;
  background:linear-gradient(var(--sky),var(--sky) 65%, var(--grass1) 65%, var(--grass2) 100%);
  color:#fff;
  display:flex;flex-direction:column;
  font-family:"Luckiest Guy",system-ui,sans-serif;
}
.privacyHeader{
  padding:18px 20px 8px;
  flex-shrink:0;
}
.privacyTitle{
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(28px,7vw,52px);
  text-shadow:0 6px 18px rgba(0,0,0,.4);
  color:#fff;
  line-height:1.1;
}
.privacyBody{
  flex:1;
  overflow:hidden;
  padding:0 16px 80px;
  display:flex;
}
.privacyScroll{
  flex:1;
  overflow-y:auto;
  background:rgba(255,255,255,0.92);
  border-radius:14px;
  padding:20px 18px;
  color:#1a1a1a;
  font-family:system-ui,sans-serif;
  font-size:clamp(13px,3.5vw,16px);
  line-height:1.6;
  -webkit-overflow-scrolling:touch;
}
.privacyScroll h2{
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(16px,4.5vw,22px);
  color:#333;
  margin:0 0 10px;
  letter-spacing:1px;
}
.privacyScroll h3{
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(13px,3.8vw,18px);
  color:#444;
  margin:18px 0 4px;
  letter-spacing:.5px;
}
.privacyScroll p{
  margin:0 0 10px;
  font-family:system-ui,sans-serif;
}
.privacyLink{
  color:#2a7ae2;
  text-decoration:underline;
  word-break:break-all;
}
.privacyReturn{}

/* How to Play overlay */
#howToPlayOverlay{
  position:fixed;inset:0;z-index:10001;
  background:#000;
  display:flex;align-items:center;justify-content:center;
}
#howToPlayScroll{
  width:100%;
  height:100%;
  overflow:scroll;
  -webkit-overflow-scrolling:touch;
}
#howToPlayImg{
  width:100%;
  height:auto;
  display:block;
  touch-action:pan-x pan-y;
  user-select:none;
  -webkit-user-drag:none;
}
#howToPlayPractice{
  left:12px;
  right:auto;
}
#howToPlayBack{}

#practiceModeLabel{
  position:fixed;
  top:calc(env(safe-area-inset-top, 0px) + 120px);
  left:50%;
  transform:translateX(-50%);
  z-index:100000;
  display:none;
  pointer-events:none;
  font-family:"Luckiest Guy", system-ui, sans-serif;
  font-size:clamp(68px,18vw,136px);
  line-height:1;
  color:#fff;
  letter-spacing:2px;
  text-shadow:0 5px 16px rgba(0,0,0,.42);
  animation:practicePulse 1.8s ease-in-out infinite;
}
@keyframes practicePulse{
  0%,100%{opacity:.58;transform:translateX(-50%) scale(.96);}
  50%{opacity:.82;transform:translateX(-50%) scale(1.04);}
}

/* No-lives overlay */
.noLivesOverlay{
  position:fixed;inset:0;z-index:10000;
  display:flex;align-items:center;justify-content:center;
  background:rgba(0,0,0,.72);
  padding:24px;box-sizing:border-box;
  cursor:pointer;
}
.noLivesCard{
  background:rgba(11,16,32,.96);
  border:3px solid #f7c948;
  border-radius:20px;
  padding:36px 28px 28px;
  max-width:360px;width:100%;
  text-align:center;
}
.noLivesMsg{
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(22px,6vw,30px);
  color:#f7c948;
  line-height:1.25;
  margin-bottom:28px;
  text-shadow:2px 2px 0 #000;
}
.noLivesLabel{
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(13px,3.5vw,17px);
  color:rgba(255,255,255,.7);
  letter-spacing:2px;
  margin-bottom:6px;
}
.noLivesTimer{
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(44px,12vw,64px);
  color:#fff;
  text-shadow:2px 2px 0 #000;
  letter-spacing:3px;
  line-height:1;
}
.noLivesAd{
  display:block;
  margin:20px auto 0;
  background:#f7c948;
  border:none;
  border-radius:10px;
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(16px,4.5vw,22px);
  color:#000;
  letter-spacing:1px;
  cursor:pointer;
  padding:10px 20px;
  -webkit-tap-highlight-color:transparent;
}
.noLivesAd:disabled{opacity:.5;}
.noLivesAdLocked{
  margin-top:20px;
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(13px,3.5vw,16px);
  color:rgba(255,255,255,.45);
  letter-spacing:1px;
  text-align:center;
}
.noLivesQuit{
  display:block;
  margin:16px auto 0;
  background:none;
  border:none;
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(24px,7vw,34px);
  color:#fff;
  text-shadow:2px 2px 0 #000;
  letter-spacing:2px;
  cursor:pointer;
  padding:4px 12px;
  -webkit-tap-highlight-color:transparent;
}

/* ── Shrub Hub screen ─────────────────────────────────────────────────────── */
#shrubHubScreen{
  position:fixed;inset:0;z-index:10000;
  background:url('/assets/shrub_hub_bg-BBxnJxrR.png') center/cover no-repeat;
  display:flex;flex-direction:column;
  font-family:"Luckiest Guy",system-ui,sans-serif;
  overflow:hidden;
}
/* Overlay that re-paints the top portion of the background over the scrolling cards,
   so cards appear to travel behind the sign as they scroll up. */
#shrubHubScreen::before{
  content:'';
  position:absolute;
  inset:0;
  background:url('/assets/shrub_hub_bg-BBxnJxrR.png') center/cover no-repeat;
  clip-path:inset(0 0 81% 0); /* show top ~19vh — exactly where cards begin */
  z-index:1;
  pointer-events:none;
}
.shrubContent{
  position:relative;
  z-index:0; /* scrolls beneath the ::before overlay */
  flex:1;overflow-y:auto;
  padding:clamp(90px,19vh,160px) 14px 90px;
  display:flex;flex-direction:column;gap:12px;
  -webkit-overflow-scrolling:touch;
  scroll-behavior:smooth;
}
.shrubSection{
  background:rgba(255,255,255,0.30);
  border-radius:18px;
  padding:16px 16px 12px;
  box-shadow:0 4px 20px rgba(0,0,0,.15);
  backdrop-filter:blur(2px);
  -webkit-backdrop-filter:blur(2px);
}
.shrubSectionTitle{
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(12px,3vw,15px);
  color:#3a1a00;
  letter-spacing:1.5px;
  margin-bottom:10px;
  text-transform:uppercase;
  text-shadow:0 1px 3px rgba(255,255,255,.6);
}
/* ── Player card ─ */
.shrubPlayerRow{
  display:flex;align-items:center;gap:12px;
  margin-bottom:12px;
}
.shrubAvatar{
  width:88px;height:88px;
  border-radius:14px;
  image-rendering:pixelated;
  flex-shrink:0;
  border:3px solid rgba(255,255,255,0.55);
  box-shadow:0 2px 8px rgba(0,0,0,0.30);
  cursor:pointer;
}
.shrubAvatar:active{transform:scale(0.94);}
.shrubPlayerInfo{
  flex:1;min-width:0;
  display:flex;flex-direction:column;gap:4px;
}
.shrubNameInput{
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(18px,5vw,26px);
  background:transparent;
  border:none;
  border-bottom:2px dashed #c8a000;
  color:#2a1a00;
  width:100%;
  outline:none;
  padding:2px 0;
  -webkit-tap-highlight-color:transparent;
  caret-color:#c8a000;
}
.shrubNameInput::placeholder{
  color:#bba060;
  font-size:clamp(14px,4vw,18px);
}
.shrubGuestBadge{
  display:inline-block;
  background:#f7c948;
  color:#2a1a00;
  border-radius:8px;
  padding:2px 10px;
  font-size:clamp(10px,2.5vw,13px);
  letter-spacing:.5px;
  align-self:flex-start;
}
.shrubStatsRow{
  display:flex;gap:8px;
}
.shrubStat{
  flex:1;
  display:flex;flex-direction:column;align-items:center;
  background:rgba(0,0,0,0.07);
  border-radius:10px;
  padding:8px 4px;
  gap:2px;
}
.shrubStatVal{
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(16px,4.5vw,22px);
  color:#1a0800;
  line-height:1;
  text-shadow:0 1px 2px rgba(255,255,255,.4);
}
.shrubStatLabel{
  font-family:system-ui,sans-serif;
  font-weight:700;
  font-size:clamp(9px,2.2vw,11px);
  color:#3a1800;
  letter-spacing:.5px;
  text-transform:uppercase;
  text-align:center;
}
/* ── Buttons ─ */
.shrubSectionBtn{
  display:flex;align-items:center;justify-content:space-between;
  width:100%;
  border:none;border-radius:12px;
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(15px,4vw,19px);
  padding:12px 16px;
  cursor:pointer;
  margin-top:8px;
  -webkit-tap-highlight-color:transparent;
  letter-spacing:.5px;
}
.shrubBtnGreen{
  background:#2a8a3b;
  color:#fff;
}
.shrubBtnGhost{
  background:rgba(0,0,0,0.28);
  color:#fff;
  text-shadow:0 1px 4px rgba(0,0,0,.5);
}
.shrubUnlockCount{
  font-size:clamp(11px,3vw,14px);
  opacity:.8;
  letter-spacing:0;
}
/* ── Sync status ─ */
.shrubSyncStatus{
  font-family:system-ui,sans-serif;
  font-size:clamp(10px,2.5vw,13px);
  color:#1a0800;
  font-weight:600;
  margin-top:10px;
  text-align:center;
}
/* ── Leaderboard ─ */
.shrubLeaderBest{
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(16px,4.5vw,20px);
  color:#1a0800;
  margin-bottom:2px;
  text-shadow:0 1px 3px rgba(255,255,255,.4);
}
/* ── Toggle ─ */
.shrubToggleRow{
  display:flex;align-items:center;justify-content:space-between;
  padding:8px 2px;
}
.shrubToggleLabel{
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(15px,4vw,19px);
  color:#1a0800;
  text-shadow:0 1px 3px rgba(255,255,255,.4);
}
.shrubToggle{
  width:54px;height:30px;
  background:#ccc;
  border-radius:15px;
  border:none;
  cursor:pointer;
  position:relative;
  transition:background .2s;
  -webkit-tap-highlight-color:transparent;
  flex-shrink:0;
}
.shrubToggle.on{ background:#2a8a3b; }
.shrubToggle::after{
  content:'';
  position:absolute;
  width:24px;height:24px;
  background:#fff;
  border-radius:50%;
  top:3px;left:3px;
  transition:left .2s;
  box-shadow:0 1px 4px rgba(0,0,0,.3);
}
.shrubToggle.on::after{ left:27px; }
.shrubDivider{
  height:1px;
  background:rgba(0,0,0,0.09);
  margin:2px 0;
}
/* ── Footer / back button ─ */
.shrubFooter{
  position:fixed;bottom:0;left:0;right:0;
  height:80px;
  background:linear-gradient(to bottom,transparent 0%,rgba(10,40,5,.85) 50%,rgba(5,25,3,1) 100%);
  display:flex;align-items:flex-end;justify-content:flex-end;
  padding:0 16px 14px;
  pointer-events:none;
  z-index:2; /* above the sign overlay */
}
.shrubBack{pointer-events:all;}

/* ── Avatar Picker Modal ──────────────────────────────────────────────────── */
#avatarPickerModal{
  position:fixed;inset:0;
  z-index:20000;
  background:rgba(0,0,0,0.55);
  display:flex;align-items:flex-end;justify-content:center;
}
.apSheet{
  background:#f9f0d8;
  border-radius:22px 22px 0 0;
  padding:20px 16px 36px;
  width:100%;max-width:480px;
  box-shadow:0 -4px 30px rgba(0,0,0,0.35);
  display:flex;flex-direction:column;align-items:center;gap:10px;
}
.apTitle{
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(18px,5vw,24px);
  color:#2a1a00;letter-spacing:.5px;
}
.apPreview{
  width:100px;height:100px;
  border-radius:16px;
  image-rendering:pixelated;
  border:3px solid rgba(0,0,0,0.18);
  box-shadow:0 2px 10px rgba(0,0,0,0.25);
}
.apSectionLabel{
  align-self:flex-start;
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(11px,3vw,13px);
  color:#7a5000;letter-spacing:1px;
  margin-bottom:-4px;
}
.apRow{
  display:flex;flex-direction:row;gap:8px;
  overflow-x:auto;width:100%;
  padding:4px 2px 6px;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
  touch-action:pan-x;
}
.apRow::-webkit-scrollbar{display:none;}
.apItem{
  flex-shrink:0;
  width:76px;
  display:flex;flex-direction:column;align-items:center;gap:3px;
  background:rgba(255,255,255,0.60);
  border-radius:12px;
  border:2px solid transparent;
  padding:5px 4px 5px;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  overflow:hidden;
  transition:border-color .15s;
  touch-action:manipulation;
}
.apItem.apSelected{
  border-color:#e85c2a;
  background:rgba(255,255,255,0.90);
}
.apCharImg{
  width:52px;height:52px;
  object-fit:contain;
  image-rendering:pixelated;
}
.apBgThumb{
  width:68px;height:42px;
  object-fit:cover;
  border-radius:6px;
  image-rendering:pixelated;
}
.apLabel{
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:10px;color:#2a1a00;
  text-align:center;
  line-height:1.1;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  width:100%;
}
.apDoneBtn{
  background:#2a8a3b;border:none;border-radius:12px;
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(16px,4.5vw,20px);color:#fff;
  padding:12px 40px;cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  width:100%;
}

/* ── Close-call popup (position/animation driven by JS RAF loop) ───────────── */
.fg-cc-banner{
  position:fixed;
  pointer-events:none;
  z-index:99997;
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(28px,8vw,54px);
  color:#fff;
  text-align:center;
  white-space:nowrap;
  text-shadow:0 10px 22px rgba(0,0,0,.4);
  letter-spacing:1px;
  transform-origin:center center;
  will-change:transform,opacity;
}

/* ── Score-gate unlock banner ──────────────────────────────────────────────── */
.fg-unlock-wrap{
  position:fixed;
  top:50%;left:50%;
  transform:translate(-50%,-50%) rotate(var(--fg-tilt,-6deg));
  z-index:99998;
  pointer-events:none;
}
.fg-unlock-banner{
  font-family:"Luckiest Guy",system-ui,sans-serif;
  color:#fff;
  text-align:center;
  text-shadow:0 14px 30px rgba(0,0,0,.35);
  letter-spacing:2px;
  line-height:1.15;
  display:flex;
  flex-direction:column;
  align-items:center;
  animation:fgUnlockPop 1.8s ease-out forwards;
}
.fg-unlock-line1{
  font-size:clamp(32px,9vw,62px);
  white-space:nowrap;
}
.fg-unlock-line2{
  font-size:clamp(20px,5.5vw,38px);
  white-space:nowrap;
  opacity:0.92;
}
@keyframes fgUnlockPop{
  0%  {opacity:0;transform:scale(0.35);}
  12% {opacity:1;transform:scale(1.1);}
  20% {transform:scale(0.95);}
  28% {transform:scale(1.0);}
  60% {opacity:1;transform:scale(1.0);}
  100%{opacity:0;transform:scale(1.0);}
}

/* ── Continue-after-crash popup ─────────────────────────────────────────────── */
/* Reuses .noLivesOverlay / .noLivesCard for the dark card with yellow border.  */
.fgContinueCard{
  padding:28px 24px 20px;
}
.fgContinuePhrase{
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(20px,5.5vw,28px);
  color:#f7c948;
  text-align:center;
  letter-spacing:1px;
  line-height:1.2;
  margin-bottom:6px;
}
.fgContinueQuestion{
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(14px,3.5vw,18px);
  color:rgba(255,255,255,.7);
  text-align:center;
  margin-bottom:18px;
  letter-spacing:1px;
}
.arDisclaimerContinue{
  display:block;
  margin:4px auto 0;
  background:#f7c948;
  border:none;
  border-radius:10px;
  color:#1a1a1a;
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(16px,4.5vw,22px);
  letter-spacing:1px;
  padding:12px 32px;
  cursor:pointer;
  width:100%;
  -webkit-tap-highlight-color:transparent;
}
.arDisclaimerContinue:active{opacity:.8;}
.fgContinueGnickelBtn{
  display:block;
  margin:12px auto 0;
  background:transparent;
  border:2px solid #f7c948;
  border-radius:10px;
  color:#f7c948;
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(13px,3.5vw,16px);
  letter-spacing:1px;
  padding:10px 18px;
  cursor:pointer;
  width:100%;
  -webkit-tap-highlight-color:transparent;
}
.fgContinueGnickelDisabled{
  opacity:.4;
  cursor:default;
  pointer-events:none;
}
.fgContinueGnickelNote{
  display:block;
  font-size:clamp(11px,2.8vw,13px);
  opacity:.7;
  margin-top:2px;
}
.fgContinueNoThanks{
  display:block;
  margin:18px auto 0;
  background:none;
  border:none;
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(16px,4.5vw,22px);
  color:rgba(255,255,255,.55);
  cursor:pointer;
  letter-spacing:1px;
  -webkit-tap-highlight-color:transparent;
}
.fgContinueNoThanks:active{ opacity:.7; }

.fgNameChangeCard{
  padding:28px 24px 20px;
}
.fgNameChangePreview{
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(22px,6.5vw,32px);
  color:#ffe15c;
  text-align:center;
  letter-spacing:.5px;
  margin:4px 0 6px;
  text-shadow:0 2px 6px rgba(0,0,0,.4);
}

/* ── Ahead-of-best popup — reuses fg-encourage-wrap for centering ──────────── */
.fg-ahead-banner{
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(38px,11vw,72px);
  color:#fff;
  text-align:center;
  text-shadow:0 14px 30px rgba(0,0,0,.35);
  letter-spacing:2px;
  white-space:nowrap;
  animation:fgUnlockPop 1.4s ease-out forwards;
}
/* Two-line variant for phrases ≥17 chars — stacked, slightly smaller per line */
.fg-ahead-banner--two-line{
  display:flex;
  flex-direction:column;
  align-items:center;
  line-height:1.1;
  white-space:normal;
}
.fg-ahead-line1,
.fg-ahead-line2{
  font-size:clamp(38px,11vw,72px);
  white-space:nowrap;
}

/* ── Encouragement popup — same font/shadow as unlock, no tilt ─────────────── */
/* Wrapper holds the centering transform so the animation never overrides it.   */
.fg-encourage-wrap{
  position:fixed;
  top:50%;left:50%;
  transform:translate(-50%,-50%);
  z-index:99997;
  pointer-events:none;
}
.fg-encourage-banner{
  font-family:"Luckiest Guy",system-ui,sans-serif;
  font-size:clamp(36px,10vw,68px);
  color:#fff;
  text-align:center;
  text-shadow:0 14px 30px rgba(0,0,0,.35);
  letter-spacing:2px;
  white-space:nowrap;
  animation:fgUnlockPop 1.8s ease-out forwards;
}

/* ── Browser PWA shell: game keeps its ratio, ad sits outside the canvas ── */
:root{
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --ad-banner-h: min(calc((100vw - var(--safe-left) - var(--safe-right)) * 0.2065), 160px);
}
html, body{
  height: 100%;
  background: #071208;
}
#appShell{
  height: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  background: #071208;
}
#playStage{
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
#wrap{
  width: 100%;
  height: 100%;
}
#livesHUD, .lives, #livesTimer{ display: none !important; }
.hud-top{
  top: calc(var(--safe-top) + var(--ad-banner-h)) !important;
  left: var(--safe-left);
  right: var(--safe-right);
}
.dailyCounter{
  left: calc(12px + var(--safe-left)) !important;
  bottom: calc(var(--safe-bottom) + 10px) !important;
}
.gnookReturn,
.privacyReturn,
#howToPlayBack,
.leaderboardBack,
.shrubBack,
.splashUpdateBtn,
#preGameBack{
  right: calc(12px + var(--safe-right)) !important;
  bottom: calc(var(--safe-bottom) + 12px) !important;
}
.bigPlayOverlay,
#fgCrash,
.noLivesOverlay,
.fgContinueOverlay,
#howToPlayOverlay,
#gnookScreen,
#shrubHubScreen,
#bgScreen,
#charScreen,
#leaderboardScreen,
#privacyScreen,
#devModeScreen,
#avatarPickerModal{
  top: calc(var(--safe-top) + var(--ad-banner-h)) !important;
  right: var(--safe-right) !important;
  bottom: var(--safe-bottom) !important;
  left: var(--safe-left) !important;
  height: auto !important;
}
.adBanner{
  position: relative;
  box-sizing: border-box;
  flex: 0 0 var(--ad-banner-h);
  width: 100%;
  height: var(--ad-banner-h);
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
  background: #102416;
  z-index: 40;
}
.adBannerLink{
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  box-sizing: border-box;
  text-decoration: none;
  color: #f7c948;
  font-family: "Luckiest Guy", system-ui, sans-serif;
  letter-spacing: 0.5px;
  font-size: clamp(16px, 4.2vw, 28px);
  text-align: center;
}
.adBannerArt{
  position: absolute;
  display: block;
  width: calc(100% / 0.9765);
  height: calc(100% / 0.605);
  left: -1.32%;
  top: -32.42%;
  max-width: none;
  max-height: none;
  object-fit: fill;
  pointer-events: none;
}
.adBannerFallback{
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.adBanner.hasArt .adBannerFallback{ display: none; }
.bgCameraKeptNote{
  margin: 8px 12px 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0,0,0,.35);
  color: #fff;
  font-family: system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
}
