/* 📖 The ZAZA Bestiary (world/js/rpg/ui-bestiary.js): a monster's page from the Monsters tab, full screen in the World's
   new look (world.css .wd: the Wardrobe's and the Class Hall's top bar, painted backdrop, gold plate, stage and glass
   panels). Here the town is painted behind, the monster stands sharp on a stage that glows in its element's colour
   (--el, set by the page), and the votes sit under it. A monster not beaten yet (.dark): a silhouette on a navy stage. */
.bst { --el: #7fd4ff; }
.bst .bst-bg img { filter: brightness(0.55) saturate(0.85); }
.bst .bst-bg::after { background: radial-gradient(ellipse 34% 46% at 50% 58%, rgba(5, 8, 28, 0) 0, rgba(5, 8, 28, 0.35) 100%), linear-gradient(90deg, rgba(5, 8, 28, 0.7), transparent 26%, transparent 74%, rgba(5, 8, 28, 0.7)), linear-gradient(0deg, rgba(5, 8, 28, 0.85), rgba(5, 8, 28, 0.2) 24%, transparent 36%); }

/* the plate: kind · level · element in small gold capitals, the name in gold, its title under it */
.wd-lb > .bst-plate { gap: 9px; margin-top: 18px; padding: 14px 64px 12px; }
.bst-plate > small { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 8px; }
.bst-plate > small > span { white-space: nowrap; }
.bst-plate > small > i { font-style: normal; color: var(--line); letter-spacing: 0; }
.bst-title { margin-top: -2px; color: var(--soft); font: 400 15px/1.1 var(--display); letter-spacing: 0.06em; }

/* the stage: a glow behind it, a ring of light under its feet, the monster on a canvas whose foot is the stage's */
.bst-glow, .bst-dais, .bst-stage canvas { position: absolute; left: 50%; translate: -50% 0; pointer-events: none; }
.bst-glow { z-index: 0; bottom: calc(var(--feet) - 40px); width: min(720px, 56vw); height: min(560px, 70dvh); border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--el) 30%, transparent), color-mix(in srgb, var(--el) 10%, transparent) 60%, transparent); }
.bst-dais { z-index: 0; bottom: var(--feet); width: min(440px, 34vw); height: 64px; translate: -50% 50%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.35) 55%, color-mix(in srgb, var(--el) 30%, transparent) 80%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--el) 55%, transparent), 0 0 26px color-mix(in srgb, var(--el) 45%, transparent), inset 0 0 18px color-mix(in srgb, var(--el) 35%, transparent); }
.bst-stage canvas { z-index: 1; bottom: calc(var(--feet) + 2px); width: min(600px, 46vw); height: clamp(180px, calc(100dvh - var(--bar) - var(--wd-top) - var(--feet) - 200px), 470px); pointer-events: auto; cursor: pointer; }
/* a boss (the Bosses tab: raid, Golden Hour, guardian, Trial): a taller stage, and it fills it (ui-bestiary.js draw) */
.bst.bst-boss .bst-stage canvas { height: clamp(180px, calc(100dvh - var(--bar) - var(--wd-top) - var(--feet) - 176px), 560px); }
.bst.dark .bst-glow { background: radial-gradient(closest-side, rgba(90, 120, 220, 0.2), rgba(60, 80, 180, 0.07) 60%, transparent); }
.bst.dark .bst-dais { background: radial-gradient(closest-side, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.35) 60%, transparent); box-shadow: 0 0 0 2px rgba(104, 132, 214, 0.35), 0 0 20px rgba(60, 90, 200, 0.3); }
.bst .bst-turn { z-index: 2; bottom: calc(var(--feet) + 110px); }
/* ‹ › beside the monster, inside the middle column with 16px to spare before the panels (--turn: from the centre to an
   arrow's inner edge; the column's half is 50% less the room's side padding, a column and the gap: world.css .wd-lb) */
.bst { --turn: min(270px, 50% - max(24px, (100% - 1320px) / 2) - 384px); }
.bst .bst-turn.l { left: calc(50% - var(--turn) - 40px); }
.bst .bst-turn.r { left: calc(50% + var(--turn)); }
@media (min-width: 1700px) { .bst { --turn: min(290px, 50% - max(32px, (100% - 1640px) / 2) - 424px); } }
.bst .bst-turn:disabled { opacity: 0.35; cursor: default; }

/* the votes: two glass pills, the share who liked it, a line on voting */
.bst-vote { display: grid; justify-items: center; gap: 6px; }
.bst-btns { display: flex; gap: 12px; }
.bst-v { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-width: 112px; height: 46px; padding: 0 20px; border: 1px solid var(--line); border-radius: 999px; background: rgba(6, 10, 32, 0.78); color: #fff1cc; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); backdrop-filter: blur(4px); }
.bst-v i { font-style: normal; font-size: 20px; line-height: 1; display: inline-flex; }
.bst-v b { font: 400 21px/1 var(--display); color: inherit; }
.bst-v:hover:not(:disabled), .bst-v:focus-visible { border-color: var(--tan); outline: 0; }
.bst-v.up.on { border-color: var(--green); background: rgba(18, 74, 44, 0.92); color: #d6ffe0; }
.bst-v.down.on { border-color: var(--red); background: rgba(86, 22, 34, 0.92); color: #ffe0e0; }
.bst-v:disabled { opacity: 0.6; cursor: default; }
.bst .bst-vote p { margin: 0; text-align: center; text-shadow: 0 1px 2px #000; }
.bst .bst-pop { color: #e2e6fa; font-size: 17px; line-height: 1.25; }
.bst .bst-pop b { color: var(--gold); font-weight: 400; }
.bst .bst-why { color: var(--soft); font-size: 15px; line-height: 1.25; }
.bst .bst-why .err { color: var(--red); }

/* the panels: its word, how it fights, where it lives and the map */
.bst .wd-p > p { margin-bottom: 0; font-size: 18px; line-height: 1.4; color: #e8ebfa; }
.bst .wd-p > p.bst-fight { color: var(--soft); font-size: 16px; line-height: 1.35; }
.bst .wd-p > p.bst-where { font-size: 17px; line-height: 1.35; }
.bst-map { overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: #0b1533; }
.bst-map canvas { display: block; width: 100%; height: auto; }
/* under the map: the tab's monsters as the Monsters tab's squares (world.css .beasts), filling the rest of the column and
   about as tall as the map's panel over it, sliding up and down (the wheel, the scrollbar, a drag with the mouse or a
   finger; a short tab's only as tall as its squares); the one shown framed in gold, its name only on hover (the plate has it) */
.bst .bst-all > .bst-grid { position: relative; max-height: 242px; margin: 0 12px; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); align-content: start; overflow: hidden auto; overscroll-behavior: contain; border-width: 1px; border-color: var(--line); border-radius: 4px; cursor: grab; scrollbar-width: thin; scrollbar-color: var(--tan) rgba(255, 255, 255, 0.06); }
.bst .bst-all > .bst-grid.drag { cursor: grabbing; }
.bst .bst-all > .bst-grid.drag .beast { pointer-events: none; }
.bst-grid .beast .bst-name { font-size: 11px; }
.bst-grid .beast.picked { outline: 2px solid var(--gold); box-shadow: 0 0 0 1px #2e3d74, inset 0 0 14px rgba(255, 210, 63, 0.35); }
.bst-grid .beast.picked:not(:hover) .bst-name { opacity: 0; }

@media (max-width: 1240px) { .bst-stage canvas { width: min(520px, 40vw); } .bst { --turn: min(250px, 50% - 368px); } }

/* Phones: the scene (plate, monster, votes over the town) on top, then its word and where it lives. */
@media (max-width: 760px), (max-width: 1100px) and (orientation: portrait) {
  .bst { --sceneh: clamp(460px, 68svh, 600px); --feet: 134px; }
  .wd-lb > .bst-plate { gap: 7px; margin-top: 16px; padding: 10px 30px; }
  .bst .wd-lb { grid-template-areas: "scene" "l" "r"; }
  .bst .bst-bg img { left: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 70%; translate: none; }
  .wd.bst .cw-tabs.top.bst-tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .wd.bst .cw-tabs.top.bst-tabs > button, .wd.bst .cw-tabs.top.bst-tabs > button:nth-child(n + 5) { grid-column: auto; padding: 0 2px; font-size: 13px; }
  .bst-glow { width: 120vw; height: calc(var(--sceneh) - 60px); bottom: calc(var(--feet) - 50px); }
  .bst-dais { width: 70vw; height: 46px; }
  .bst-stage canvas { width: calc(100% - 96px); height: calc(var(--sceneh) - var(--feet) - 140px); }
  .bst .bst-turn { bottom: calc(var(--feet) + 70px); width: 38px; height: 38px; }
  .bst .bst-turn.l { left: 8px; }
  .bst .bst-turn.r { left: auto; right: 8px; }
  .bst .wd-go { padding-bottom: 10px; }
  .bst-v { min-width: 96px; height: 42px; }
  .bst .bst-pop { font-size: 15px; }
  .bst .bst-why { font-size: 14px; }
  .bst .bst-all > .bst-grid { max-height: min(286px, 46svh); grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); }
}
@media (min-width: 600px) and (max-width: 1100px) and (orientation: portrait) {
  .bst .wd-lb { grid-template-areas: "scene scene" "l r"; }
  .bst-stage canvas { width: min(560px, 70vw); }
}
/* a phone on its side: the scene on the left (44%), the panels scrolling on the right */
@media (orientation: landscape) and (max-height: 500px) and (min-width: 561px) {
  .bst .wd-lb { grid-template-areas: "plate cols" "stage cols" "go cols"; } /* (not the phones' "scene" "l" "r": 561-760 wide matches both) */
  /* ‹ › either side of the monster (the stage's middle is 22%), clear of the edges: the left one 16px in from the screen's
     edge or 8px past the notch's safe area, the right one 16px short of the panels (they start 10px past 44% of the room
     less its right padding, which is the notch's safe area on an iPhone) */
  .bst { --feet: 92px; --turn: min(17vw, 22% - 34px - max(16px, var(--sw-l, 0px) + 8px), 22% - 0.44 * max(10px, var(--sw-r, 0px)) - 40px); }
  .bst-glow, .bst-dais, .bst-stage canvas { left: 22%; }
  .bst-glow { width: 40vw; height: 70dvh; }
  .bst-dais { width: 30vw; height: 34px; }
  .bst-stage canvas { width: 34vw; height: calc(100dvh - var(--bar) - var(--feet) - 70px); }
  .bst .bst-turn { bottom: calc(var(--feet) + 50px); width: 34px; height: 34px; }
  .bst .bst-turn.l { left: calc(22% - var(--turn) - 34px); }
  .bst .bst-turn.r { left: calc(22% + var(--turn)); right: auto; }
  .bst .bst-plate > small { display: none; }
  .wd-lb > .bst-plate { margin-top: 6px; padding: 6px 24px; gap: 4px; }
  .bst-v { min-width: 80px; height: 34px; padding: 0 12px; }
  .bst-v b { font-size: 17px; }
  .bst .bst-pop, .bst .bst-why { font-size: 13px; }
  .bst .bst-all > .bst-grid { max-height: 228px; }
}
