/* Study Quest — account.css (V7.8 round 6 lane U, v78-account): the character select's LEFT sidebar (js/ui-account.js), the master
 * Letopis, the Letopis World chapter's heat map (js/ui-heat.js). Flat colour + the game's own textures; NEVER gradients. */

/* =====================================================================================================
 * THE LEFT SIDEBAR: the chosen hero's plate and live numbers (the roster's forged panel, mirrored on the left)
 * ===================================================================================================== */
.glue-select .glue-select__side {
  position: absolute;
  left: clamp(56px, 6vw, 110px);
  top: max(calc(var(--cx-screen-band) + 48px), 8vh);
  width: clamp(260px, 22vw, 330px);
  max-height: calc(100% - max(calc(var(--cx-screen-band) + 48px), 8vh) - 168px);
  display: flex;
  flex-direction: column;
  margin: 0;
  z-index: 3;
  overflow: hidden;
}
.glue-select__side .ei-roster__title { flex: none; }
.glue-select__side-body { flex: none; }
/* the plate, out of the sky and into the panel: left aligned, no shadow pool behind it */
.glue-select__side .glue-select__plate {
  position: static;
  transform: none;
  max-width: none;
  align-items: flex-start;
  text-align: left;
  gap: 4px;
  pointer-events: auto;
}
.glue-select__side .glue-select__plate::before { content: none; }
.glue-select.has-side .glue-select__side .glue-select__name { font-size: clamp(24px, 3.4vh, 32px); white-space: normal; overflow-wrap: anywhere; line-height: 1.1; }
.glue-select__side .glue-select__meta { font-size: 14px; padding: 4px 14px 3px; }
.glue-select__side .glue-select__class { font-size: 15px; line-height: 1.3; }
.glue-select__side .glue-select__class.ac-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }
.glue-select__side .glue-select__where { font-size: 15px; }
.glue-select__side .glue-select__clocks { margin-top: 2px; font-size: 13.5px; }
.glue-select__side .glue-select__plan, .glue-select__side .jr-plate, .glue-select__side .glue-select__sleep { text-align: left; }
.ac-side__stats {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  margin: 10px 0 0;
  padding: 8px 0 0;
  border-top: 1px solid rgba(176, 122, 60, 0.35);
}
.ac-side__row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 2px; border-bottom: 1px solid rgba(176, 122, 60, 0.16); cursor: default; }
.ac-side__row dt { font: 700 11.5px/1.5 var(--cx-font-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--cx-text-dim); }
.ac-side__row dd { margin: 0; font: 600 14px/1.4 var(--cx-font-num, sans-serif); color: var(--cx-text); text-align: right; }
.ac-side__row:hover dd { color: var(--cx-gold-text); }
.ac-side__book { flex: none; margin-top: 12px; }

/* a small window: the old place over the hero, the plate only */
.glue-select.is-compact .glue-select__side {
  left: max(var(--glue-hero-x), calc(23vw + 6px));   /* never off the left edge, never under the roster */
  top: calc(var(--cx-screen-band) + 10px);
  transform: translateX(-50%);
  width: auto;
  max-width: 46vw;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
}
.glue-select.is-compact .glue-select__side::before, .glue-select.is-compact .glue-select__side::after,
.glue-select.is-compact .glue-select__side .ei-roster__title, .glue-select.is-compact .glue-select__side .codex-divider,
.glue-select.is-compact .ac-side__stats { display: none; }
.glue-select.is-compact .glue-select__side .glue-select__plate { align-items: center; text-align: center; gap: 3px; }
.glue-select.is-compact .ac-side__book { margin-top: 4px; min-height: 0; padding: 3px 8px; font-size: 11px; }

/* =====================================================================================================
 * THE MASTER LETOPIS: a book of its own, as big as the screen allows (over the character select too)
 * ===================================================================================================== */
.ac-layer {
  position: fixed;
  inset: 0;
  z-index: 978;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 1.1vw, 18px);
  background: rgba(8, 6, 4, 0.72);
  opacity: 0;
  transition: opacity 0.18s ease-out;
}
.ac-layer.is-open { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .ac-layer { transition: none; } }
.ac-book {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-width: 1500px;
  color: #1d140c;
  background: #f1e5c8;
  border: 10px solid #5c150c;
  border-radius: 6px;
  box-shadow: 0 0 0 1px #000, inset 0 0 0 1px #c9a86a, 0 24px 60px rgba(0, 0, 0, 0.7);
}
.ac-head { display: flex; align-items: center; gap: 14px; padding: 12px 18px 8px 46px; background: #e8d7ae; border-bottom: 2px solid #7a1d10; }
.ac-x-slot { flex: none; width: 0; }   /* the one close X (css/closex.css) stands in the book's top-left corner */
.ac-title { flex: 1 1 auto; margin: 0; font: 700 clamp(20px, 2.4vw, 30px)/1.1 var(--cx-font-title); letter-spacing: 0.06em; color: #5c150c; }
.ac-title small { display: block; margin-top: 2px; font: italic 500 15px/1.2 var(--cx-font-body); letter-spacing: 0; color: #5a4632; }
.ac-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.ac-tab { padding: 7px 14px; font: 700 13px/1 var(--cx-font-label); letter-spacing: 0.08em; text-transform: uppercase; color: #45331f; background: #f4ead2; border: 1px solid #a8936c; border-radius: 3px; cursor: pointer; }
.ac-tab:hover { color: #7a1d10; border-color: #7a1d10; }
.ac-tab.is-on { color: #f6ecd2; background: #7a1d10; border-color: #5c150c; }
.ac-tab:focus-visible { outline: 2px solid #1f3a76; outline-offset: 1px; }
.ac-page { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px clamp(16px, 3vw, 44px) 22px; font: 400 16px/1.45 var(--cx-font-body); outline: none; }
.ac-foot { flex: none; padding: 6px 16px; font: 500 13px/1.3 var(--cx-font-num, sans-serif); color: #5a4632; background: #e8d7ae; border-top: 1px solid #a8936c; }
.ac-foot .codex-kbd { color: #45331f; }
.ac-say { margin: 2px 0 12px; font: italic 400 17px/1.4 var(--cx-font-body); }
.ac-note { margin: 8px 0; font: 400 14.5px/1.4 var(--cx-font-body); color: #5a4632; }
.ac-h2 { margin: 18px 0 8px; font: 700 20px/1.2 var(--cx-font-title); letter-spacing: 0.04em; color: #7a1d10; border-bottom: 1px solid #c9b48a; padding-bottom: 3px; }
.ac-h2 small, .ac-h3 small { margin-left: 10px; font: italic 500 14px/1 var(--cx-font-body); letter-spacing: 0; color: #5a4632; }
.ac-h3 { display: flex; align-items: baseline; gap: 6px; margin: 0 0 6px; font: 700 17px/1.25 var(--cx-font-title); color: #2a1c10; }
.ac-h3 small { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ac-figs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 4px 0 10px; }
.ac-fig { padding: 8px 10px; background: #f8efd9; border: 1px solid #c9b48a; border-left: 4px solid #7a1d10; cursor: default; }
.ac-fig b { display: block; font: 700 22px/1.15 var(--cx-font-num, sans-serif); color: #2a1c10; }
.ac-fig span { font: 700 11.5px/1.3 var(--cx-font-label); letter-spacing: 0.08em; text-transform: uppercase; color: #5a4632; }
.ac-tbl { margin: 4px 0 10px; font: 400 15px/1.3 var(--cx-font-num, sans-serif); }
.ac-tr { display: grid; grid-template-columns: minmax(120px, 1.1fr) minmax(140px, 1.6fr) 54px 74px 70px 56px 70px minmax(110px, 1fr); gap: 0 10px; align-items: center; padding: 6px 4px; border-bottom: 1px solid rgba(168, 147, 108, 0.5); }
.ac-tbl--k .ac-tr { grid-template-columns: minmax(150px, 1.4fr) repeat(6, minmax(64px, 1fr)); }
.ac-th { font: 700 11.5px/1.2 var(--cx-font-label); letter-spacing: 0.06em; text-transform: uppercase; color: #5a4632; border-bottom: 2px solid #a8936c; }
.ac-tr.is-active { background: #f8efd9; }
.ac-tr .r { text-align: right; }
.ac-tr .num { font-variant-numeric: tabular-nums; }
.ac-hero { font-weight: 700; color: #2a1c10; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-hero em { font: italic 500 12.5px var(--cx-font-body); color: #7a1d10; }
.ac-course { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ac-sw { display: inline-block; width: 11px; height: 11px; margin-right: 6px; vertical-align: -1px; border: 1px solid rgba(29, 20, 12, 0.4); }
.ac-svg { display: block; width: 100%; max-width: 760px; height: auto; margin: 2px 0 4px; }
.ac-ax { font: 600 11px var(--cx-font-num, sans-serif); fill: #45331f; }
.ac-axl { stroke: #c9b48a; stroke-width: 1; }
.ac-svg rect:hover { stroke: #1d140c; stroke-width: 1.2; }
.ac-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 2px 0 10px; font: 500 14px/1.3 var(--cx-font-num, sans-serif); color: #45331f; }
.ac-legend i { display: inline-block; width: 11px; height: 11px; margin-right: 5px; vertical-align: -1px; border: 1px solid rgba(29, 20, 12, 0.35); }
.ac-bar { display: flex; height: 18px; max-width: 760px; margin: 4px 0 10px; background: #e3d3ad; border: 1px solid #a8936c; }
.ac-bar i { display: block; height: 100%; }
.ac-sm { margin: 8px 0 14px; padding: 10px 12px 6px; background: #f8efd9; border: 1px solid #c9b48a; break-inside: avoid; }
.ac-ledger { margin: 0; }
.ac-ledger > div { display: grid; grid-template-columns: minmax(150px, 0.45fr) 1fr; gap: 10px; padding: 4px 0; border-bottom: 1px solid rgba(168, 147, 108, 0.4); cursor: default; }
.ac-ledger dt { font: 700 12px/1.5 var(--cx-font-label); letter-spacing: 0.06em; text-transform: uppercase; color: #5a4632; }
.ac-ledger dd { margin: 0; font: 400 15.5px/1.4 var(--cx-font-body); }
@media (min-width: 1200px) { .ac-smotra-cols { columns: 2; column-gap: 28px; } }
@media (max-width: 760px), (max-height: 520px) {
  .ac-head { flex-wrap: wrap; padding: 8px 10px 6px 40px; gap: 8px; }
  .ac-title { font-size: 18px; }
  .ac-title small { display: none; }
  .ac-tab { padding: 5px 8px; font-size: 11px; }
  .ac-page { padding: 8px 10px 12px; font-size: 14px; }
  .ac-foot { display: none; }
  .ac-tr { grid-template-columns: minmax(80px, 1fr) minmax(80px, 1.2fr) 40px 56px; font-size: 13px; }
  .ac-tr > :nth-child(n+5) { display: none; }
  .ac-tbl--k .ac-tr { grid-template-columns: minmax(80px, 1fr) repeat(3, minmax(44px, 1fr)); }
  .ac-figs { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .ac-fig b { font-size: 17px; }
  .ac-ledger > div { grid-template-columns: 1fr; gap: 0; }
}

/* the link on the Letopis's Overview */
.ac-link-p .ac-open { cursor: pointer; }

/* =====================================================================================================
 * THE HEAT MAP in the Letopis's World chapter (js/ui-heat.js): five stepped flat bands, the paths, zoom + drag
 * ===================================================================================================== */
.hm-map { padding: 0; }
.hm-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; padding: 5px 6px; background: #ead9b2; border-bottom: 1px solid #c9b48a; }
.hm-grp { display: inline-flex; gap: 3px; }
.hm-b { min-width: 28px; padding: 3px 8px; font: 700 12.5px/1.2 var(--cx-font-num, sans-serif); color: #45331f; background: #f4ead2; border: 1px solid #a8936c; border-radius: 3px; cursor: pointer; }
.hm-b:hover { border-color: #7a1d10; color: #7a1d10; }
.hm-b.is-on { color: #f6ecd2; background: #7a1d10; border-color: #5c150c; }
.hm-b:focus-visible { outline: 2px solid #1f3a76; outline-offset: 1px; }
.hm-sheet { position: relative; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.hm-map.is-dragging .hm-sheet { cursor: grabbing; }
.hm-svg { display: block; width: 100%; height: auto; aspect-ratio: 520 / 340; background: #e3cf9f; }
.hm-zn { font-family: Cinzel, serif; font-weight: 700; letter-spacing: 0.08em; fill: #4a3520; stroke: #ead9b2; paint-order: stroke; }
.hm-pn { font-family: Alegreya, serif; fill: #22170d; stroke: #f1e5c8; paint-order: stroke; }
.hm-pn.is-here { font-weight: 700; }
.hm-legend { display: flex; flex-wrap: wrap; gap: 2px 12px; padding: 5px 6px 2px; font: 500 12.5px/1.3 var(--cx-font-num, sans-serif); color: #45331f; }
.hm-legend i { display: inline-block; width: 12px; height: 12px; margin-right: 4px; vertical-align: -2px; border: 1px solid rgba(29, 20, 12, 0.35); }
.hm-legend .hm-k-trail { width: 18px; height: 0; border: 0; border-top: 2px solid #3a2614; vertical-align: middle; }
.hm-legend .hm-k-road { width: 18px; height: 0; border: 0; border-top: 2px dashed #7a1d10; vertical-align: middle; }
.hm-say { margin: 2px 6px 6px; font: 400 14px/1.35 var(--cx-font-body); color: #3a2a1a; }
.book-layer.lp-book.is-single .hm-svg { height: 100px; aspect-ratio: auto; }   /* one small page: the whole sheet (bar, map, legend) fits one page */
.book-layer.lp-book.is-single .hm-say { display: none; }
.book-layer.lp-book.is-single .hm-legend span:nth-child(n+6) { display: none; }
.book-layer.lp-book.is-single .hm-bar { padding: 3px 4px; }
.book-layer.lp-book.is-single .hm-b { padding: 2px 5px; font-size: 11px; }
.book-layer.lp-book.is-single .hm-legend { font-size: 11px; gap: 1px 8px; }

/* the master Letopis's head band and keys: the page's generic h1 / kbd looks do not reach in here */
.ac-layer .ac-title { display: block; flex: 1 1 auto; min-width: 0; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; text-align: left; }
.ac-layer .ac-title .ot { display: inline; }
.ac-layer .ac-title small { display: block; }
.ac-layer .ac-foot .codex-kbd { display: inline-block; min-width: 18px; padding: 1px 5px; font: 700 12px/1.3 var(--cx-font-num, sans-serif); color: #2a1c10; background: #f8efd9; border: 1px solid #a8936c; border-radius: 3px; box-shadow: none; text-align: center; }
