/* Plantoria demo: cards added by js/demo.js. Same look as the game's new cards
   (tips / tutorial: dark brown gradient, thin gold frame, gold tag and button),
   not the old wooden builder modal. */
.pl-backdrop {
  position: absolute; inset: 0; z-index: 9999;
  background: rgba(8, 4, 16, .72);
}
.pl-card {
  position: absolute; left: 50%; top: 50%; z-index: 10000;
  transform: translate(-50%, -50%);
  box-sizing: border-box; width: min(92%, 360px); max-height: 92%; overflow-y: auto;
  padding: 22px 22px 18px; text-align: center;
  background: linear-gradient(170deg, #3d2a18 0%, #2b1e12 55%, #1f160d 100%);
  border: 2.67px solid #a47219; border-radius: 18px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 220, 150, .14), inset 0 0 0 1px rgba(60, 35, 10, .6);
  color: #f4e7c8; font-family: 'Fredoka', 'Segoe UI', system-ui, sans-serif;
  animation: plCardIn .25s cubic-bezier(.34, 1.56, .64, 1);
}
.pl-card-wide { width: min(94%, 460px); }
@keyframes plCardIn { from { opacity: 0; transform: translate(-50%, -50%) scale(.9); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.pl-card-x {
  position: absolute; top: 6px; right: 10px; background: none; border: 0; cursor: pointer;
  color: rgba(240, 232, 208, .55); font-size: 26px; line-height: 1;
}
.pl-card-x:hover { color: #f0e8d0; }
.pl-card-tag {
  display: inline-block; margin-bottom: 12px; padding: 3px 10px; border-radius: 12px;
  background: linear-gradient(135deg, #f0c050, #e6a832); color: #2a1e08;
  font-size: 10px; font-weight: 800; letter-spacing: 2px; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.pl-card-art { display: grid; place-items: center; margin-bottom: 10px; }
.pl-card-art .gi { width: 56px; height: 56px; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .45)); }
.pl-card-bloom { width: 120px; height: 120px; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .45)); }
.pl-card-title { font-size: 18px; font-weight: 800; color: #f0e8d0; margin-bottom: 8px; letter-spacing: .3px; }
.pl-card-body { font-size: 13px; line-height: 1.55; color: rgba(240, 232, 208, .86); margin-bottom: 14px; padding: 0 6px; }
.pl-card-body b, .pl-card-next b { color: #e6a832; font-weight: 700; }
.pl-card-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.pl-card-btn {
  display: block; padding: 9px 16px; border-radius: 8px; cursor: pointer; text-decoration: none;
  font: 700 13px 'Fredoka', 'Segoe UI', system-ui, sans-serif;
  background: rgba(255, 255, 255, .08); color: rgba(240, 232, 208, .82); border: 1px solid rgba(255, 255, 255, .12);
  transition: transform .1s, filter .15s, background .15s;
}
.pl-card-btn:hover { background: rgba(255, 255, 255, .14); }
.pl-card-btn.primary {
  background: linear-gradient(135deg, #e6a832, #c78a1e); color: #2a1e08; border-color: transparent;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.pl-card-btn.primary:hover { transform: translateY(-1px); filter: brightness(1.08); }
.pl-card-btn:active { transform: translateY(1px); }

/* Goals list, rewards, next chapter, stats */
.pl-card-goals { list-style: none; margin: 0 0 12px; padding: 0; text-align: left; font-size: 13px; }
.pl-card-goals li {
  position: relative; padding: 7px 10px 7px 30px; margin-bottom: 5px; border-radius: 9px;
  background: rgba(0, 0, 0, .22); border: 1px solid rgba(230, 168, 50, .18);
}
.pl-card-goals li::before {
  content: ''; position: absolute; left: 10px; top: 50%; width: 9px; height: 9px; margin-top: -6.5px;
  border: 2px solid #e6a832; border-radius: 3px;
}
.pl-card-reward { display: flex; justify-content: center; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 12px; color: rgba(240, 232, 208, .7); }
.pl-card-reward.big { font-size: 15px; margin: 2px 0 14px; }
.pl-pill {
  display: inline-flex; align-items: center; gap: .3em; padding: .3em .85em; border-radius: 12px;
  color: #fff; font-weight: 800; text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}
.pl-pill .gi { width: 1.15em; height: 1.15em; object-fit: contain; }
.pl-pill.coin { background: linear-gradient(180deg, #ffd76a, #e2a531); color: #4a2c06; text-shadow: none; box-shadow: 0 3px 0 #9a6a14; }
.pl-pill.gem { background: linear-gradient(180deg, #5fd3ff, #1f8fd0); box-shadow: 0 3px 0 #13628f; }
.pl-card-next {
  text-align: left; font-size: 13px; line-height: 1.45; color: rgba(240, 232, 208, .86);
  background: rgba(0, 0, 0, .22); border: 1px solid rgba(230, 168, 50, .18); border-radius: 10px;
  padding: 9px 12px; margin-bottom: 10px;
}
.pl-card-next span { display: block; font-size: 10px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: #e0b450; }
.pl-card-next b { display: block; font-size: 15px; margin-bottom: 2px; }
.pl-card-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 12px; }
.pl-card-stats div { background: rgba(0, 0, 0, .22); border: 1px solid rgba(230, 168, 50, .18); border-radius: 10px; padding: 7px 4px; font-size: 11px; color: rgba(240, 232, 208, .75); }
.pl-card-stats b { display: block; font-size: 17px; color: #e6a832; }
@media (max-width: 480px) { .pl-card-stats { grid-template-columns: repeat(2, 1fr); } }

/* Chapter goals tracker (top-right, under the HUD; tap to collapse) */
.pl-demo-goals {
  position: absolute; right: 1%; top: 15%; z-index: 900; width: 21em; max-width: 40%;
  background: linear-gradient(170deg, rgba(61, 42, 24, .93) 0%, rgba(31, 22, 13, .93) 100%);
  border: 2px solid #a47219; border-radius: 12px;
  padding: .45em .7em .55em; color: #f4e7c8; font: 500 13px/1.25 'Fredoka', sans-serif;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 220, 150, .14); cursor: pointer; user-select: none;
}
.pl-goals-head { font-weight: 800; color: #f0e8d0; margin-bottom: 3px; }
.pl-goals-head span { display: block; font-size: .75em; font-weight: 800; color: #e0b450; text-transform: uppercase; letter-spacing: .08em; }
.pl-goal { display: flex; gap: 6px; align-items: baseline; padding: 2px 0; color: rgba(240, 232, 208, .86); }
.pl-goal i { flex: 0 0 .9em; height: .9em; border: 2px solid #e6a832; border-radius: 3px; font-style: normal; font-size: .75em; line-height: .9em; text-align: center; color: #2a1e08; }
.pl-goal b { margin-left: auto; color: #e6a832; white-space: nowrap; font-weight: 700; }
.pl-goal.ok { opacity: .65; text-decoration: line-through; }
.pl-goal.ok i { background: linear-gradient(135deg, #f0c050, #e6a832); }
.pl-demo-goals.collapsed .pl-goal { display: none; }
.pl-demo-goals.collapsed .pl-goals-head { margin: 0; }
.is-mob .pl-demo-goals { top: 12%; max-width: 62%; }

/* No diamond store in the demo (the HUD + stays and shows "available online") */
.diamond-offers-sep { display: none !important; }

/* Game reward popups (level up, achievements, orders) rendered as cards */
.pl-reward-overlay { z-index: 9999; background: rgba(8, 4, 16, .72); backdrop-filter: none; -webkit-backdrop-filter: none; }
.pl-card-art-big { font-size: 52px; line-height: 1; }
.pl-card-art-big .gi, .pl-card-art-big img { width: 64px; height: 64px; object-fit: contain; }
.pl-card-rows { margin: 0 0 14px; }
.pl-card-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px; margin-bottom: 5px; border-radius: 9px;
  background: rgba(0, 0, 0, .22); border: 1px solid rgba(230, 168, 50, .18); font-size: 13px; text-align: left;
}
.pl-card-row b { margin-left: auto; font-weight: 800; font-size: 15px; }
.pl-row-ic { display: inline-grid; place-items: center; width: 22px; height: 22px; font-size: 18px; }
.pl-row-ic .gi, .pl-row-ic img { width: 22px; height: 22px; object-fit: contain; }

/* "available online at plantoria.net" with the address big and gold */
.pl-card-site { margin: -4px 0 14px; }
.pl-card-site span { display: block; font-size: 11px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(240, 232, 208, .7); }
.pl-card-site b {
  display: block; margin-top: 2px; font-size: 30px; font-weight: 800; line-height: 1.1; letter-spacing: .3px;
  background: linear-gradient(180deg, #ffe08a, #e6a832); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 rgba(60, 35, 10, .9));
}

/* Text on the menu buttons' label strips */
.pl-btn-label {
  position: absolute; z-index: 2; display: flex; align-items: center; justify-content: center;
  pointer-events: none; white-space: nowrap; overflow: hidden;
  font-family: 'Fredoka', sans-serif; font-weight: 700; color: #fff7e0; letter-spacing: .02em;
  text-shadow: 0 1px 0 #3a2208, 0 0 3px rgba(0, 0, 0, .6);
}

/* ===== Ending cinematic (showEnding in demo.js) ===== */
.pl-end {
  position: absolute; inset: 0; z-index: 10050; overflow: hidden;
  font-family: 'Fredoka', 'Segoe UI', system-ui, sans-serif; color: #f4e7c8; text-align: center;
  animation: plEndIn .5s ease both;
}
.pl-end.out { animation: plEndOut .4s ease both; }
@keyframes plEndIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes plEndOut { to { opacity: 0; } }
.pl-end-bg { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 32%, rgba(92, 58, 18, .97) 0%, rgba(30, 17, 8, .98) 48%, rgba(8, 4, 2, .98) 100%); }
.pl-end-rays {
  position: absolute; left: 50%; top: 32%; width: 220vmax; height: 220vmax; margin: -110vmax 0 0 -110vmax;
  background: repeating-conic-gradient(from 0deg, rgba(255, 210, 110, .13) 0deg 7deg, transparent 7deg 22deg);
  -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 34%); mask-image: radial-gradient(circle, #000 0%, transparent 34%);
  opacity: 0; transform: scale(.4); transition: opacity 1s ease, transform 1.4s cubic-bezier(.2, .8, .2, 1);
  animation: plEndSpin 40s linear infinite;
}
.pl-end.reveal .pl-end-rays { opacity: 1; transform: scale(1); }
@keyframes plEndSpin { to { rotate: 360deg; } }
.pl-end-motes { position: absolute; inset: 0; pointer-events: none; }
.pl-end-mote {
  position: absolute; left: var(--x); bottom: -30px; width: calc(22px * var(--s)); height: auto; opacity: 0;
  animation: plEndMote var(--t) linear var(--w) infinite;
}
@keyframes plEndMote { 0% { transform: translateY(0) rotate(0); opacity: 0; } 15% { opacity: .9; } 85% { opacity: .6; } 100% { transform: translateY(-120vh) rotate(200deg); opacity: 0; } }

.pl-end-scene {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 3% 5%; box-sizing: border-box; gap: 1.1vmin;
  transition: opacity .55s ease, transform .55s ease;
}
.pl-end-s2 { opacity: 0; pointer-events: none; transform: translateY(24px); }
.pl-end.s2 .pl-end-s1 { opacity: 0; pointer-events: none; transform: translateY(-24px) scale(.96); }
.pl-end.s2 .pl-end-s2 { opacity: 1; pointer-events: auto; transform: none; }

/* Hero: six flowers orbit, converge, flash, Bloom */
.pl-end-hero { position: relative; width: min(34vmin, 300px); aspect-ratio: 1; flex: none; }
.pl-end-glow {
  position: absolute; inset: -18%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 224, 140, .75) 0%, rgba(255, 190, 70, .28) 38%, transparent 68%);
  opacity: 0; transform: scale(.3); transition: opacity .8s ease, transform 1.2s cubic-bezier(.2, .8, .2, 1);
}
.pl-end.reveal .pl-end-glow { opacity: 1; transform: scale(1); animation: plEndPulse 2.6s ease-in-out 1.2s infinite; }
@keyframes plEndPulse { 50% { transform: scale(1.08); opacity: .8; } }
.pl-end-ring { position: absolute; inset: 0; animation: plEndSpin 3s linear infinite; }
.pl-end-orb {
  position: absolute; left: 50%; top: 50%; width: 30%; height: 30%; margin: -15% 0 0 -15%; object-fit: contain;
  transform: rotate(var(--a)) translateY(-118%) rotate(calc(-1 * var(--a)));
  filter: drop-shadow(0 0 10px rgba(255, 220, 140, .7));
  animation: plEndOrbIn .7s cubic-bezier(.34, 1.56, .64, 1) both;
  transition: transform .35s cubic-bezier(.6, 0, .9, .4), opacity .35s ease;
}
@keyframes plEndOrbIn { from { opacity: 0; scale: .2; } to { opacity: 1; scale: 1; } }
.pl-end.converge .pl-end-orb { transform: rotate(var(--a)) translateY(0) rotate(calc(-1 * var(--a))) scale(.3); opacity: 0; }
.pl-end-flash {
  position: absolute; inset: 10%; border-radius: 50%; background: radial-gradient(circle, #fff 0%, rgba(255, 240, 200, .9) 30%, transparent 70%);
  opacity: 0; transform: scale(.2);
}
.pl-end.converge .pl-end-flash { animation: plEndFlash .7s ease-out .2s both; }
@keyframes plEndFlash { 0% { opacity: 0; transform: scale(.2); } 30% { opacity: 1; transform: scale(1.6); } 100% { opacity: 0; transform: scale(2.4); } }
.pl-end-bloom {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  filter: drop-shadow(0 0 22px rgba(255, 215, 120, .85)) drop-shadow(0 12px 18px rgba(0, 0, 0, .5));
  opacity: 0; transform: scale(.2) translateY(20%);
}
.pl-end.reveal .pl-end-bloom { animation: plEndBloom .9s cubic-bezier(.34, 1.56, .64, 1) both, plEndFloat 3.4s ease-in-out .9s infinite; }
@keyframes plEndBloom { from { opacity: 0; transform: scale(.2) translateY(20%); } to { opacity: 1; transform: none; } }
@keyframes plEndFloat { 50% { transform: translateY(-4%); } }

/* Text of scene 1 fades in after the reveal */
.pl-end-s1 > :not(.pl-end-hero) { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.pl-end.text .pl-end-s1 > :not(.pl-end-hero) { opacity: 1; transform: none; }
.pl-end.text .pl-end-s1 > :nth-child(3) { transition-delay: .1s; }
.pl-end.text .pl-end-s1 > :nth-child(4) { transition-delay: .2s; }
.pl-end.text .pl-end-s1 > :nth-child(5) { transition-delay: .3s; }
.pl-end.text .pl-end-s1 > :nth-child(6) { transition-delay: .6s; }

.pl-end-tag {
  display: inline-block; padding: .35em 1.1em; border-radius: 99px; font-size: clamp(9px, 1.5vmin, 13px); font-weight: 800; letter-spacing: .2em;
  background: linear-gradient(135deg, #f7d77a, #e6a832); color: #2a1e08; box-shadow: 0 2px 10px rgba(230, 168, 50, .45);
}
.pl-end-title {
  font-size: clamp(20px, 4.6vmin, 42px); font-weight: 700; line-height: 1.1; color: #fff3cf; margin-top: .2em;
  background: linear-gradient(180deg, #fff8dc 30%, #f2c65a 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 0 rgba(90, 50, 10, .9));
}
.pl-end-title.big { font-size: clamp(22px, 5.4vmin, 50px); }
.pl-end-sub { font-size: clamp(12px, 2.1vmin, 18px); color: rgba(244, 231, 200, .86); max-width: 34em; line-height: 1.4; }
.pl-end-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.2vmin; width: min(100%, 620px); margin: .6vmin 0 1vmin; }
.pl-end-stats div {
  background: linear-gradient(180deg, rgba(255, 220, 150, .1), rgba(0, 0, 0, .25)); border: 1px solid rgba(230, 168, 50, .35);
  border-radius: 14px; padding: 1.1vmin .5vmin; font-size: clamp(9px, 1.5vmin, 13px); color: rgba(244, 231, 200, .75);
}
.pl-end-stats b { display: block; font-size: clamp(16px, 3.4vmin, 30px); color: #f2c65a; line-height: 1.15; }

.pl-end-btn {
  min-width: min(80%, 280px); padding: .75em 1.6em; border-radius: 99px; cursor: pointer;
  font: 700 clamp(13px, 2.1vmin, 18px) 'Fredoka', 'Segoe UI', system-ui, sans-serif;
  background: rgba(0, 0, 0, .3); color: rgba(244, 231, 200, .85); border: 1.5px solid rgba(230, 168, 50, .45);
}
.pl-end-btn.primary { background: linear-gradient(180deg, #f7d77a, #e6a832 60%, #c98a1c); color: #2a1e08; border-color: #fff0b8; box-shadow: 0 4px 0 #8a5a12, 0 8px 24px rgba(230, 168, 50, .4); }
.pl-end-btn:hover { filter: brightness(1.08); }

/* Scene 2: the invitation */
.pl-end-feats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.4vmin; width: min(100%, 760px); margin: 1.4vmin 0; }
.pl-end-feat {
  display: flex; flex-direction: column; align-items: center; gap: .6vmin; padding: 1.6vmin 1vmin;
  background: linear-gradient(180deg, rgba(255, 220, 150, .1), rgba(0, 0, 0, .28)); border: 1px solid rgba(230, 168, 50, .35); border-radius: 16px;
  opacity: 0; transform: translateY(14px) scale(.96); transition: opacity .45s ease, transform .45s cubic-bezier(.34, 1.56, .64, 1);
}
.pl-end.s2 .pl-end-feat { opacity: 1; transform: none; }
.pl-end.s2 .pl-end-feat:nth-child(2) { transition-delay: .12s; }
.pl-end.s2 .pl-end-feat:nth-child(3) { transition-delay: .24s; }
.pl-end.s2 .pl-end-feat:nth-child(4) { transition-delay: .36s; }
.pl-end-feat span .gi { width: clamp(38px, 8vmin, 72px); height: clamp(38px, 8vmin, 72px); object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .5)); }
.pl-end-feat p { margin: 0; font-size: clamp(10px, 1.7vmin, 15px); line-height: 1.3; color: rgba(244, 231, 200, .88); }
.pl-end-feat b { color: #f2c65a; }
.pl-end-stores { display: flex; gap: 1.6vmin; flex-wrap: wrap; justify-content: center; margin: .6vmin 0 1.4vmin; }
.pl-end-store {
  display: flex; align-items: center; gap: .7em; padding: .6em 1.3em .6em 1em; border-radius: 14px; text-decoration: none;
  background: linear-gradient(180deg, #1b130b, #0b0805); border: 1.5px solid rgba(255, 220, 150, .55); color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .5), 0 0 0 4px rgba(230, 168, 50, .12); font-size: clamp(14px, 2.5vmin, 22px); font-weight: 700;
  animation: plEndStore 2.4s ease-in-out infinite;
}
.pl-end-store.web { animation-delay: 1.2s; }
@keyframes plEndStore { 50% { box-shadow: 0 6px 20px rgba(0, 0, 0, .5), 0 0 0 6px rgba(230, 168, 50, .28), 0 0 24px rgba(255, 200, 90, .35); } }
.pl-end-store svg { width: 1.5em; height: 1.5em; fill: #f2c65a; flex: none; }
.pl-end-store span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; }
.pl-end-store small { font-size: .5em; letter-spacing: .14em; color: rgba(244, 231, 200, .7); font-weight: 600; }
a.pl-end-store:hover { filter: brightness(1.15); transform: translateY(-1px); }

/* Phones (portrait game box) */
.is-mob .pl-end-hero { width: min(52vw, 260px); }
.is-mob .pl-end-stats, .is-mob .pl-end-feats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.is-mob .pl-end-scene { gap: 1.4vh; }
@media (prefers-reduced-motion: reduce) { .pl-end *, .pl-end { animation-duration: .01s !important; transition-duration: .01s !important; } }

/* Rewarded ad buttons (demo.js): the player's choice, always labelled AD */
.pl-ad-tag { display: inline-block; margin-left: .35em; padding: .05em .45em; border-radius: 6px; vertical-align: middle;
  background: #f0c050; color: #2a1e08; font: 800 .62em 'Fredoka', sans-serif; letter-spacing: .08em; }
.detail-action-btn.pl-ad-btn { background: linear-gradient(180deg, #4f8f3a, #2f6524) !important; border-color: #9fdc7a !important; }
.or-refresh.pl-ad-orders { margin-top: 8px; background: linear-gradient(180deg, #4f8f3a, #2f6524); border-color: #9fdc7a; color: #fff; }
.nd-ad { width: 100%; margin-bottom: .6em; padding: .75em 1em; border: none; border-radius: 10px; cursor: pointer;
  background: linear-gradient(135deg, #5aa845, #2f6524); color: #fff; font: 700 1em 'Fredoka', sans-serif; box-shadow: 0 3px 10px rgba(90, 168, 69, .35); }
.nd-ad .gi { width: 1.2em; height: 1.2em; vertical-align: -.2em; }
.cr-skip.pl-ad-crate { background: linear-gradient(180deg, #4f8f3a, #2f6524); border-color: #9fdc7a; color: #fff; }
.pl-card-btn .pl-ad-tag { font-size: .7em; }

/* Settings > avatar (desktop): big avatar + name on the left, all 20 avatars in three rows
   on the right, so the picker uses the window's width instead of a narrow 5-column column. */
.game-container:not(.portrait-mode) .avatar-section {
  display: grid; grid-template-columns: auto 1fr; column-gap: 1.6em; row-gap: .25em; align-items: center;
  grid-template-areas: "cur label" "cur picker" "name picker"; text-align: left; padding: .2em .4em .9em;
}
.game-container:not(.portrait-mode) .avatar-section .avatar-current { grid-area: cur; justify-self: center; }
.game-container:not(.portrait-mode) .avatar-section .avatar-username { grid-area: name; justify-self: center; margin: 0; }
.game-container:not(.portrait-mode) .avatar-section .avatar-picker-label { grid-area: label; margin: 0; align-self: end; }
.game-container:not(.portrait-mode) .avatar-section .avatar-picker {
  grid-area: picker; max-width: none; margin: 0; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .55em .7em; align-self: start; max-width: 30em;
}
.game-container:not(.portrait-mode) .avatar-section .avatar-option img.gi-avatar { width: 90%; height: 90%; }
.pl-ad-premium { background: linear-gradient(180deg, #4f8f3a, #2f6524) !important; border-color: #9fdc7a !important; color: #fff !important; }
.tile-action-btn.pl-ad-premium { margin-top: 4px; }
.pl-ad-premium.off { filter: grayscale(.6) brightness(.8); }
/* Chapter goals stay under every window (they covered the Shop tabs) */
body:has(.game-modal-overlay) .pl-demo-goals, body:has(.plant-detail-overlay.open) .pl-demo-goals { visibility: hidden; }

/* Crate buttons (pay / video) stacked in one column on the right, so they never cover the name and timer */
.pl-cr-acts { display: flex; flex-direction: column; align-items: stretch; gap: 6px; flex: none; margin-left: auto; }
.pl-cr-acts > button { margin: 0 !important; white-space: nowrap; justify-content: center; }
.is-mob .pl-cr-acts > button { font-size: 13px; padding: 7px 12px; }

/* Community badge + join card (builds with links) */
.pl-join-badge {
  position: absolute; right: 1.2%; top: 46%; z-index: 880; width: 9.5em; padding: .35em .35em .5em; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: .25em; font: 700 13px 'Fredoka', sans-serif; color: #2a1e08;
  background: linear-gradient(170deg, rgba(61, 42, 24, .9), rgba(31, 22, 13, .9)); border: 2px solid #e6a832; border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45), 0 0 14px rgba(230, 168, 50, .35); animation: plJoinBob 3s ease-in-out infinite;
}
.pl-join-badge > img { width: 100%; height: auto; display: block; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .4)); }
.pl-join-badge span { display: block; width: 100%; padding: .3em .2em; border-radius: 10px; text-align: center;
  background: linear-gradient(180deg, #f7d77a, #e6a832); box-shadow: 0 2px 0 #8a5a12; font-size: .88em; line-height: 1.15; white-space: normal; }
.pl-join-badge span .gi { width: 1.05em; height: 1.05em; vertical-align: -.15em; }
.pl-join-badge:hover { filter: brightness(1.08); }
@keyframes plJoinBob { 50% { transform: translateY(-4px); } }
.is-mob .pl-join-badge { right: auto; left: 2%; top: 40%; width: 5.6em; font-size: 10.5px; padding: .25em .25em .35em; }
body:has(.game-modal-overlay) .pl-join-badge, body:has(.plant-detail-overlay.open) .pl-join-badge, body:has(.pl-end) .pl-join-badge { visibility: hidden; }
.pl-join-card .pl-join-logo { width: 62%; max-width: 230px; height: auto; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .5)); }
.pl-join-gift { display: flex; gap: 10px; align-items: center; text-align: left; margin: 0 0 14px; padding: 10px 12px; border-radius: 12px;
  background: linear-gradient(90deg, rgba(143, 209, 106, .2), rgba(143, 209, 106, .06)); border: 1px solid rgba(143, 209, 106, .5); font-size: 13px; color: #dcefcf; }
.pl-join-gift > span { font-size: 28px; }
.pl-join-gift b { color: #b6ec95; }
.pl-join-gift small { display: block; color: rgba(220, 239, 207, .7); font-size: 11px; margin-top: 2px; }
.pl-join-gift .gi { width: 1.1em; height: 1.1em; vertical-align: -.2em; }

/* Community invite inside the New Discovery card (builds with links) */
.pl-disc-join { display: flex; align-items: center; gap: 10px; margin: 8px 0 10px; padding: 9px 10px; border-radius: 12px; text-align: left;
  background: linear-gradient(90deg, rgba(230, 168, 50, .18), rgba(230, 168, 50, .05)); border: 1px solid rgba(230, 168, 50, .5);
  font: 500 12.5px/1.35 'Fredoka', sans-serif; color: #f0e2bf; }
.pl-disc-join > span { font-size: 24px; flex: none; }
.pl-disc-join b { color: #ffd36b; }
.pl-disc-join a { flex: none; padding: 7px 12px; border-radius: 99px; text-decoration: none; font-weight: 700; color: #2a1e08;
  background: linear-gradient(180deg, #f7d77a, #e6a832); box-shadow: 0 2px 0 #8a5a12; white-space: nowrap; }

/* Goals and community badge stay under every overlay (plant card, list for sale, need diamonds) */
body:has(.plant-card-overlay) .pl-demo-goals, body:has(.plant-card-overlay) .pl-join-badge,
body:has(.need-diamonds-overlay) .pl-demo-goals, body:has(.need-diamonds-overlay) .pl-join-badge,
body:has(.pl-card) .pl-join-badge { visibility: hidden; }

.pl-join-gift > span .gi { width: 1.2em; height: 1.2em; vertical-align: -.25em; }
.pl-join-badge span .gi { display: inline-block; width: 1.25em; height: 1.25em; vertical-align: -.28em; margin: 0 .05em; }
.pl-join-gift > span .gi { width: 32px; height: 32px; }
.pl-disc-logo { width: 54px; height: auto; flex: none; }
.pl-disc-join a .gi, .pl-card-btn .gi { width: 1.1em; height: 1.1em; vertical-align: -.2em; }

/* Quick tutorial (demo): tooltip and banner cards become a gold pill: the step's game icon in a
   medallion, one short title, a soft glow; no part header, dots, body text or waiting line. */
.pl-quick-tutorial .onb-card:not(.onb-card-center) .onb-part,
.pl-quick-tutorial .onb-card:not(.onb-card-center) .onb-progress,
.pl-quick-tutorial .onb-card:not(.onb-card-center) .onb-body,
.pl-quick-tutorial .onb-card:not(.onb-card-center) .onb-wait { display: none !important; }
.pl-quick-tutorial .onb-card:not(.onb-card-center) {
  display: grid !important; grid-template-columns: auto 1fr; align-items: center; column-gap: 12px; row-gap: 2px;
  width: auto !important; min-width: 0; max-width: min(92vw, 440px); padding: 9px 22px 9px 9px !important; text-align: left;
  background: linear-gradient(135deg, #5a3c1a 0%, #3a2711 55%, #2a1c0c 100%) !important;
  border: 2px solid #f0c050 !important; border-radius: 999px !important;
  box-shadow: 0 0 0 3px rgba(42, 30, 8, .55), 0 10px 26px rgba(0, 0, 0, .5), 0 0 22px rgba(240, 192, 80, .45) !important;
  animation: plTipIn .45s cubic-bezier(.34, 1.56, .64, 1) both, plTipGlow 2.4s ease-in-out .6s infinite;
}
@keyframes plTipIn { from { opacity: 0; scale: .7; } to { opacity: 1; scale: 1; } }
@keyframes plTipGlow { 50% { box-shadow: 0 0 0 3px rgba(42, 30, 8, .55), 0 10px 26px rgba(0, 0, 0, .5), 0 0 34px rgba(255, 210, 110, .75); } }
.pl-quick-tutorial .onb-card:not(.onb-card-center) .onb-emoji {
  grid-row: 1 / span 2; width: 52px; height: 52px; margin: 0 !important; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 40% 35%, #fff6d2 0%, #f4cf6d 45%, #c88a22 100%);
  box-shadow: inset 0 -3px 0 rgba(120, 70, 10, .45), 0 3px 8px rgba(0, 0, 0, .45);
}
.pl-quick-tutorial .onb-card:not(.onb-card-center) .onb-emoji img { width: 38px !important; height: 38px !important; margin: 0 !important; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35)); }
.pl-quick-tutorial .onb-card:not(.onb-card-center) .onb-title {
  grid-column: 2; margin: 0 !important; font-size: 1.25em !important; line-height: 1.2; color: #fff6dc !important;
  text-shadow: 0 2px 0 rgba(60, 30, 5, .7);
}
.pl-quick-tutorial .onb-card:not(.onb-card-center) .onb-title b { color: #ffd76a; }
.pl-quick-tutorial .onb-card:not(.onb-card-center) > :not(.onb-emoji):not(.onb-title):not(.onb-arrow) { grid-column: 2; margin: 0 !important; padding: 0 !important; }
.pl-quick-tutorial .onb-card:not(.onb-card-center) .onb-btn-skip { font-size: 11px !important; opacity: .55; padding: 0 !important; background: none !important; text-align: left; }
.pl-quick-tutorial .onb-card:not(.onb-card-center) .onb-arrow { border-top-color: #f0c050 !important; }
/* The pill sits just under the shelf, not over the menu buttons */
.pl-quick-tutorial .game-container:not(.portrait-mode) .onb-card-banner,
.pl-quick-tutorial:not(.is-mob) .onb-card-banner { top: 75% !important; bottom: auto !important; }
/* Portals without external links (CrazyGames, GameDistribution): no social share buttons on the specimen card */
.pl-demo-none .spc-tile:has([data-spc-share]), .pl-demo-soft .spc-tile:has([data-spc-share]),
.pl-demo-none [data-spc-share], .pl-demo-soft [data-spc-share] { display: none !important; }

/* Harvest reveal (demo.js): the flower big in golden light before the flower card */
.pl-reveal { position: absolute; inset: 0; z-index: 10040; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 42%, rgba(70, 45, 15, .88) 0%, rgba(15, 9, 4, .95) 60%); cursor: pointer;
  font-family: 'Fredoka', 'Segoe UI', system-ui, sans-serif; animation: plRevIn .25s ease both; }
.pl-reveal.out { animation: plRevOut .26s ease both; }
@keyframes plRevIn { from { opacity: 0; } }
@keyframes plRevOut { to { opacity: 0; transform: scale(1.04); } }
.pl-reveal-rays { position: absolute; left: 50%; top: 42%; width: 200vmax; height: 200vmax; margin: -100vmax 0 0 -100vmax;
  background: repeating-conic-gradient(from 0deg, rgba(255, 215, 120, .14) 0deg 8deg, transparent 8deg 24deg);
  -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 32%); mask-image: radial-gradient(circle, #000 0%, transparent 32%);
  animation: plRevSpin 22s linear infinite; }
@keyframes plRevSpin { to { rotate: 360deg; } }
.pl-reveal-glow { position: absolute; left: 50%; top: 42%; width: 46vmin; height: 46vmin; margin: -23vmin 0 0 -23vmin; border-radius: 50%;
  background: radial-gradient(circle, var(--rc) 0%, transparent 65%); opacity: .55; animation: plRevPulse 1.8s ease-in-out infinite; }
@keyframes plRevPulse { 50% { opacity: .85; transform: scale(1.08); } }
.pl-reveal-plant { position: relative; width: min(38vmin, 300px); height: auto; filter: drop-shadow(0 0 20px rgba(255, 220, 140, .7)) drop-shadow(0 12px 16px rgba(0, 0, 0, .55));
  animation: plRevPop .6s cubic-bezier(.34, 1.56, .64, 1) both, plRevFloat 3s ease-in-out .6s infinite; }
@keyframes plRevPop { from { opacity: 0; transform: scale(.2) translateY(30%); } }
@keyframes plRevFloat { 50% { transform: translateY(-3%); } }
.pl-reveal-tag { position: relative; margin-bottom: 1.5vmin; padding: .35em 1.2em; border-radius: 99px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  font-size: clamp(12px, 2vmin, 17px); color: #2a1e08; background: linear-gradient(180deg, #ffe58a, #e6a832); box-shadow: 0 3px 0 #8a5a12, 0 0 18px rgba(255, 210, 110, .6);
  animation: plRevPop .5s cubic-bezier(.34, 1.56, .64, 1) .15s both; }
.pl-reveal-name { position: relative; margin-top: 1.4vmin; font-size: clamp(22px, 4.6vmin, 42px); font-weight: 700; color: #fff6dc;
  text-shadow: 0 3px 0 rgba(60, 30, 5, .8), 0 0 18px rgba(255, 200, 90, .5); animation: plRevPop .5s ease .25s both; }
.pl-reveal-rarity { position: relative; margin-top: .4vmin; font-size: clamp(13px, 2.2vmin, 19px); font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: var(--rc); text-shadow: 0 2px 0 rgba(0, 0, 0, .5); animation: plRevPop .5s ease .35s both; }
.pl-reveal-tap { position: absolute; bottom: 7%; font-size: 13px; color: rgba(255, 240, 210, .55); animation: plRevIn .4s ease 1s both; }
body:has(.pl-reveal) .pl-demo-goals, body:has(.pl-reveal) .pl-join-badge, body:has(.pl-reveal) .onb-card, body:has(.pl-reveal) .onb-pointer { visibility: hidden; }

/* Pots (desktop layout only; the phone layout positions them differently and was fine): the status
   icon and the + become a small badge on the pot's top-right corner (they sat on the soil, over the
   pot art); the growth dots move up onto the pot so they don't touch the label. */
.game-container:not(.portrait-mode) .pot-slot-sprite .pot-action-indicator,
.game-container:not(.portrait-mode) .pot-slot-sprite .pot-slot-plus,
.game-container:not(.portrait-mode) .pot-slot-visual .pot-slot-plus {
  inset: -4% -12% auto auto !important; top: -4% !important; right: -12% !important; left: auto !important; bottom: auto !important;
  transform: none !important; z-index: 8 !important;
}
.game-container:not(.portrait-mode) .pot-slot-sprite .pot-action-indicator { animation: plBadgePulse 2s ease-in-out infinite !important; }
.game-container:not(.portrait-mode) .pot-slot-sprite .pot-action-indicator.timer-active { animation: plBadgeFlip 2s ease-in-out infinite !important; }
@keyframes plBadgePulse { 50% { transform: scale(1.14); } }
@keyframes plBadgeFlip { 25%, 75% { transform: rotate(180deg); } }
.game-container:not(.portrait-mode) .pot-hud { bottom: 10% !important; }
.game-container:not(.portrait-mode) .pot-slot-label { font-size: .92em; margin-top: 3px; }

/* Soil picker opens above the pot: lift the shelf over the HUD icons (z<=84) and the open pot over its neighbours. */
.layout-el:has(.soil-picker) { z-index: 90 !important; }
.pot-slot-wrap:has(.soil-picker) { z-index: 5; }
