/* goonlab — a bot's page, the maker's (templates/bots/_panel.html) and a
   published bot's (templates/bots/public.html): docs/bots/spec/74-the-bots-
   page-redesigned.md. build.css draws the cover, the title and the facts'
   list; this sheet the head's line and buttons, the two columns, the Preview
   and its large picture, the scenario's cut and the cover's part. Nothing
   here touches another page. */

/* ---- the head ---- */
.bot-line { flex-wrap: wrap; margin: 0; }
.bot-line > span:last-child { overflow-wrap: anywhere; min-width: 0; }
.bot-own-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.3rem; }
.bot-own-buttons .btn { white-space: nowrap; }
/* "Delete this scenario" (templates/bots/_delete.html): its form takes no box of its own,
   so its button sits in the row as the others do; the sentence in its place takes a line */
.bot-own-buttons > .bot-delete-form { display: contents; }
.bot-own-buttons > .bot-delete-kept { flex-basis: 100%; margin: 0; }
.bot-cover-part {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; gap: 0.9rem 1.4rem; align-items: flex-start;
  padding-top: 1rem; border-top: 1px solid var(--line);
}
.bot-cover-part .bot-cover-field { margin-top: 0; min-width: 0; }

/* ---- the boxes ---- */
.bot-page .bot-section-title { margin: 0 0 0.7rem; }
.bot-page .order-panel { margin-top: 0; }
.bot-page .bot-publish { margin-top: 0; }
.bot-about .bot-facts { margin-top: 0; }
/* the names stand in one column wide enough for the longest of them ("Custom
   visuals and sounds"), so that every value starts at the same place */
@media (min-width: 721px) {
  .bot-about .bot-facts dt { min-width: 13.5rem; }
}
.bot-about .hint { margin: 0.7rem 0 0; }

/* ---- one column on a narrow screen, in the order head, Preview, Scenario,
   Start a stream, About this bot, publishing (docs/bots/spec/118, section 7:
   the Scenario right under the Preview) ---- */
.bot-layout { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.bot-main, .bot-side { display: contents; }
.bot-layout .bot-preview { order: 1; }
/* the description (templates/bots/_description.html) stands right above the Scenario:
   the same place in the order, and before it in the page */
.bot-layout .bot-description,
.bot-layout .bot-scenario { order: 2; }
.bot-layout .bot-start-panel, .bot-layout .bot-public-start, .bot-layout .bot-public-copy { order: 3; }
.bot-layout .bot-about { order: 4; }
.bot-layout .bot-publish { order: 5; }
.bot-layout .bot-public-report { order: 6; }

/* ---- two on a wide one: the right column stays in view while the left
   one scrolls, when it fits on the screen whole (static/bots/page.js) ---- */
@media (min-width: 900px) {
  .bot-layout {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(19rem, 23rem);
    align-items: start;
  }
  .bot-main, .bot-side { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
  .bot-side.is-sticky { position: sticky; top: 5rem; }
  .bot-side .bot-start-lists { grid-template-columns: 1fr; }
}

/* ---- the Preview: five in a row on a wide screen, a row pushed sideways on
   a narrow one ---- */
.bot-preview-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.6rem;
}
.bot-preview-item {
  display: block; border-radius: 8px; overflow: hidden; background: var(--panel-2);
  outline-offset: 2px;
}
.bot-preview-item img {
  display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
  transition: transform 0.15s ease;
}
.bot-preview-item:hover img { transform: scale(1.03); }
@media (max-width: 720px) {
  .bot-preview-grid {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain; padding-bottom: 0.3rem;
  }
  .bot-preview-grid li { flex: 0 0 38%; scroll-snap-align: start; }
}
@media (prefers-reduced-motion: reduce) {
  .bot-preview-item img { transition: none; }
}

/* the large picture over the page */
.bot-viewer {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(8, 4, 14, 0.92);
  display: flex; align-items: center; justify-content: center;
  padding: 3.5rem 3.5rem 1.5rem;
}
.bot-viewer-img {
  display: block; max-width: 100%; max-height: 100%; object-fit: contain;
  border-radius: 6px; box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
}
.bot-viewer-close { position: absolute; top: 0.8rem; right: 0.8rem; }
.bot-viewer-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 2.6rem; height: 3.4rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  font: inherit; font-size: 2rem; line-height: 1; cursor: pointer;
}
.bot-viewer-arrow:hover, .bot-viewer-arrow:focus-visible { border-color: var(--accent); }
.bot-viewer-prev { left: 0.6rem; }
.bot-viewer-next { right: 0.6rem; }
html.bot-viewer-open, html.bot-viewer-open body { overflow: hidden; }
@media (max-width: 720px) {
  .bot-viewer { padding: 3.5rem 0.5rem 4.5rem; }
  .bot-viewer-arrow { top: auto; bottom: 0.8rem; transform: none; }
  .bot-viewer-prev { left: calc(50% - 3.2rem); }
  .bot-viewer-next { right: calc(50% - 3.2rem); }
}

/* ---- Scenario: cut after the sixth line with a soft fade ---- */
/* the box takes the paragraph's own text size (goonlab.css, .order-prompt-full),
   so that 9.6em is six of its lines */
.bot-scenario-text { font-size: 0.92rem; line-height: 1.6; }
.bot-scenario-text .order-prompt-full { margin: 0; font-size: inherit; line-height: inherit; }
.bot-scenario-text.is-cut {
  max-height: 9.6em; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.bot-scenario-toggle { margin-top: 0.6rem; }

/* ---- the description: the Scenario's text size, shown whole ---- */
.bot-description-text { margin: 0; font-size: 0.92rem; line-height: 1.6; }

/* ---- the list "Your streams with this bot" at the very bottom, across the full width
   (templates/bots/_bot_streams.html, docs/bots/spec/84, section 1): the rows of the
   list "Replays" (build.css), a shade lighter than the box they stand in ---- */
.bot-streams { margin-top: 1rem; min-width: 0; }
.bot-streams .replay-row { background: var(--panel-2); }
.bot-streams .replay-row-ask { background: var(--panel); }

/* ---- the maker's page while a bot is made: the boxes across the full width ---- */
.bot-page > .bot-description, .bot-page > .bot-scenario, .bot-page > .bot-about { min-width: 0; }

@media (max-width: 720px) {
  .bot-own-buttons .btn { flex: 1 1 auto; }
}
