/* The Meme Lab (Dev, 1 Nov): open to everyone, separate from the Lounge's Exclusive Meme Maker. A home-page section under the
   Library since 4 Nov (#lab in index.html); sits on top of css/styles.css for the colours, the bar and the buttons. Desktop,
   after Dev's mock (3 Nov): the title and the two buttons over a line, then the tools on the left (2 parts) and the picture and
   its words box on the right (3 parts). Buttons follow the Meme Library's: 50px, 8px corners, #1d1e24, a teal tab when picked.
   Under 900px (the site's one phone line): the picture stays pinned under the bar, so you see it change while you use the tools under it. */
.lab [hidden],.saver [hidden]{display:none}
.lab{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,3fr);grid-template-rows:auto auto 1fr;gap:32px 56px;align-items:start}
.labhead{grid-column:1/-1;display:flex;align-items:center;gap:20px;padding-bottom:20px;border-bottom:1px solid var(--card-border)}
.labstage{grid-column:2;grid-row:2}
.labtools{grid-column:1;grid-row:2/4}
#stage{display:block;width:100%;height:auto;border-radius:12px;background:var(--card)}

.labtitle{font-weight:700;text-transform:uppercase;font-size:40px;line-height:1.1}
.labtitle .white{color:var(--white)}
.labtitle .mint{color:var(--mint)}
.labmodes{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;margin-bottom:16px;padding:4px;border:1px solid var(--card-stroke);border-radius:999px;background:var(--card)}   /* a pill, after getbullish.xyz's menu; picked is the Library tabs' teal (Dev, 3 Nov; was lime, then the Download teal) */
.labmodes button{height:50px;padding:0 6px;border:0;border-radius:999px;background:none;color:rgba(255,255,255,.8);font-size:15px;font-weight:500;text-transform:uppercase;letter-spacing:.02em;white-space:nowrap;cursor:pointer;transition:background-color 150ms ease,color 150ms ease}
.labmodes [aria-pressed=true]{background:var(--tab-active);color:var(--white)}
@media(hover:hover) and (pointer:fine){.labmodes button:hover{color:var(--white)}.labmodes [aria-pressed=true]:hover{color:var(--white)}}
.lab:not([data-mode=custom]) .labtabs{display:none}   /* Background and Ape are Custom's tools */
.lab[data-mode=portrait] #stage{width:auto;max-width:100%;max-height:calc(100vh - 390px);margin:0 auto}   /* square: never taller than the screen */
.labtabs{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin-bottom:16px}
/* the Meme Library's buttons (.libtab and its page squares, css/styles.css): 50px, 8px corners, #1d1e24, two shades lighter on
   hover. A picked Background/Ape tab: #272930 with a 2px #363941 edge inside (Dev's Figma, 3 Nov) */
.labtabs button{height:50px;padding:0 18px;border:1px solid transparent;border-radius:8px;background:#1d1e24;color:var(--white);
  font-size:15px;font-weight:500;text-transform:uppercase;letter-spacing:.02em;cursor:pointer;
  transition:background-color 160ms ease,border-color 160ms ease,transform 160ms var(--ease-out)}
.labtabs button:active{transform:scale(.97)}
@media(hover:hover) and (pointer:fine){.labtabs button:not([aria-pressed=true]):hover{background:#272930}}
.labtabs [aria-pressed=true]{background:#272930;box-shadow:inset 0 0 0 2px #363941}
.labpart{display:none;padding-bottom:16px}
.lab[data-mode=custom][data-tab=bg] [data-part=bg],.lab[data-mode=custom][data-tab=ape] [data-part=ape],
.lab[data-mode=scene] [data-part=scene],.lab[data-mode=portrait] [data-part=portrait]{display:block}   /* a scene or portrait grid stays up while you work on the words */

.picks{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.pick{display:block;padding:0;background:var(--card);border:2px solid var(--card-stroke);border-radius:8px;overflow:hidden;cursor:pointer;aspect-ratio:16/9;
  transition:border-color 150ms ease}
.pick img{width:100%;height:100%;object-fit:cover;pointer-events:none}
#apes{grid-template-columns:repeat(5,1fr)}   /* the apes as squares, five to a row (Dev, 4 Nov): every ape sits in the left 610 of its 1200-wide layer */
#apes .pick{aspect-ratio:1}
#apes .pick img{object-position:left center}   /* cover + left: the left 675x675 square, the whole ape and no empty space */
#portraits .pick{aspect-ratio:1}
.pick[aria-pressed=true]{border-color:var(--lime)}
@media(hover:hover) and (pointer:fine){.pick:hover{border-color:var(--teal)}.pick[aria-pressed=true]:hover{border-color:var(--lime)}}

#words{display:block;width:100%;height:62px;padding:16px 14px;resize:none;border:1px solid var(--teal);border-radius:8px;background:#000;color:#fff;
  font:350 20px/28px var(--sans);caret-color:var(--lime);transition:border-color 150ms ease}   /* the Lounge meme maker's box (.mmtext). 16px: anything smaller makes an iPhone zoom the page on focus */
/* the box's prompt (Dev, 4 Nov): types itself out, then the hero's lime caret blinks after it until the box is used (css/styles.css .herotype) */
.wordsbox{position:relative;margin-top:24px}
.wordshint{position:absolute;top:0;left:0;right:0;padding:16px 15px;font:350 20px/28px var(--sans);color:rgba(255,255,255,.5);pointer-events:none;white-space:nowrap;overflow:hidden}
.wordshint .caret{display:inline-block;width:.55em;height:1.05em;margin-left:2px;vertical-align:-.15em;background:var(--lime);animation:blink 1.06s steps(1,end) infinite}
.wordshint.off .caret{display:none}   /* clicked in: the box's own lime caret takes over */
@media(prefers-reduced-motion:reduce){.wordshint .caret{animation:none}}
#words:focus{outline:none;border-color:var(--lime)}
.btn.ghost{background:none;border:2px solid var(--card-stroke);color:var(--white);box-shadow:none}

.labout{display:flex;gap:12px;margin-left:auto}
.labout .btn{height:44px;padding:0 28px;font-size:15px;white-space:nowrap}   /* the Library's DOWNLOAD ALL */
.labnote{margin-top:12px;font-size:14px;color:var(--mint)}

.saver{margin:auto;width:min(calc(100vw - 32px),900px);max-width:none;padding:16px;border:2px solid var(--card-stroke);border-radius:12px;background:var(--ground);color:var(--white)}
.saver::backdrop{background:rgba(0,0,0,.8)}
.saver img{display:block;width:100%;height:auto;border-radius:8px;-webkit-touch-callout:default}   /* the press-and-hold menu must stay on */
.saver p{margin:14px 0;font-size:16px;text-align:center}
.saverbtns{display:flex;gap:8px;justify-content:center}

@media(max-width:900px){
  .lab{display:block}
  .labstage{position:sticky;top:60px;z-index:2;margin:0 -22px;padding:8px 22px;background:var(--ground)}   /* pinned under the bar, edge to edge so nothing shows past it (lost in the 3 Nov layout rebuild, put back 4 Nov) */
  #stage{border-radius:8px}
  .wordsbox{margin-top:12px}
  #words{height:50px;padding:12px 14px}
  .wordshint{padding:12px 15px}   /* tighter: the box rides along with the pinned picture */
  #words,.wordshint{font-size:18px;line-height:24px}   /* the prompt larger and lighter (Dev, 4 Nov); a little smaller here, where the box is 50px tall */
  .lab[data-mode=portrait] #stage{max-height:45vh}   /* a full-width square left too little room for the tools under it */
  .labhead{flex-wrap:wrap;gap:14px;margin-bottom:8px;padding-bottom:16px}
  .labtitle{width:100%;font-size:32px}
  .labout{width:100%;margin-left:0}   /* the two buttons share the width under the title */
  .labout .btn{flex:1;height:44px;padding:0 14px}
  .labtools{padding-top:12px}
  .labtabs{margin-top:4px}
  .labmodes button{font-size:13px}   /* CUSTOM SCENE in capitals only just fit a third of a 375px screen at 15px */
}

/* the Lab as an app in a box (Dev, 7 Nov): a very dark gray behind the section (the login picture first, swapped the same day), the Lab in a black card with a 1px line */
.labsect{background:var(--card)}
.labsect .lab{background:#000;border:1px solid var(--card-border);border-radius:12px;padding:40px}
@media(max-width:900px){.labsect .lab{padding:22px}.labsect .labstage{background:#000}}   /* 22px = the pinned picture's edge-to-edge margin */

/* the lightbox (Dev, 9 Nov): the Lab over the dimmed Library, BACK TO THE LIBRARY above it. The dialog scrolls; the page under it does not */
.labdlg{margin:auto;padding:16px 24px 24px;border:0;background:transparent;color:var(--white);width:min(1280px,100%);max-width:none;max-height:100dvh;overflow:auto;overscroll-behavior:contain}
.labdlg::backdrop{background:rgba(6,7,9,.86);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
html:has(.labdlg[open]){overflow:hidden}
.labdlg .labsect{background:none}
.labback{display:inline-flex;align-items:center;gap:8px;min-height:44px;margin-bottom:8px;padding:0;border:0;background:none;color:var(--mint);
  font:600 15px var(--sans);letter-spacing:.04em;cursor:pointer;transition:color 150ms ease}
@media(hover:hover) and (pointer:fine){.labback:hover{color:var(--white)}}
@media(max-width:900px){.labdlg{width:100%;height:100dvh;padding:4px 0 0}.labback{margin-left:16px}.labdlg .labstage{top:0}.labdlg .lab{border-radius:0;border-left:0;border-right:0}}
.libmake{display:block;margin-top:18px;white-space:nowrap}   /* under REPLY POSTS, the same button as the tabs (Dev, 11 Nov) */
@media(max-width:900px){.libmake{margin-top:12px}}
