/* Study Quest — buffs.css (V7.8 round 6, lane S, v78-hud): the health bar, Capital's soft pulse while you really study, the
 * buff list under the portrait (js/ui-buffs.js), the pinned frame over the books and the writer, the card pause (js/ui-cardtime.js).
 * Flat colour + texture, NEVER a gradient (the user, 25 Oct). The pulse is the one loop the user asked for (30 Oct ~12:20:
 * "it should also pulsate"); it runs only while you study and never under reduced motion. */

:root {
  /* a fine forged speckle: flat dots, no gradient */
  --bl-tex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Crect x='1' y='2' width='1' height='1' fill='%23ffffff' fill-opacity='.05'/%3E%3Crect x='5' y='5' width='1' height='1' fill='%23000000' fill-opacity='.35'/%3E%3Crect x='6' y='1' width='1' height='1' fill='%23ffffff' fill-opacity='.04'/%3E%3Crect x='2' y='6' width='1' height='1' fill='%23000000' fill-opacity='.3'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------------ the plate grows a little: health over Capital */
.hud .uf-plate { height: 82px; }
.hud .uf-buffs { top: 98px; }
.hud .uf-talent { top: 98px; }
.hud .uf.has-talents .uf-buffs { top: 130px; }
.uf-hp {
  position: relative;
  height: 12px;
  margin: 2px 0 2px;
  border: 1px solid #000;
  border-radius: 2px;
  background: #0b0c0d var(--bl-tex);
  box-shadow: 0 0 0 1px #3a3f46;
  overflow: hidden;
  cursor: help;
}
.uf-hp-fill { position: absolute; left: 0; top: 0; bottom: 0; background: #3f8f37 var(--bl-tex); box-shadow: inset 0 1px 0 rgba(200, 255, 190, 0.22); }
.uf-hp .bar-text { font-size: 9.5px; line-height: 12px; padding: 0 4px; }
.uf-hp .bar-text .l { font: 700 9.5px/12px var(--cx-font-label); letter-spacing: 0.05em; }
.hud.compact .uf-hp { height: 6px; margin: 1px 0; }
.hud.compact .uf-hp .bar-text { display: none; }
.hud.compact .uf-plate { height: 52px; }

/* Capital: a soft pulse while you really study (engine: status.momentum.studying) */
.uf-res.is-studying .uf-res-fill, .bl-pin-res.is-studying i { animation: blStudy 2.6s ease-in-out infinite; }
.uf-res.is-studying { box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.92), 0 0 0 1px #6b5524, 0 0 6px rgba(230, 180, 34, 0.35); }
@keyframes blStudy { 0%, 100% { filter: brightness(0.92); } 50% { filter: brightness(1.28); } }
@media (prefers-reduced-motion: reduce) { .uf-res.is-studying .uf-res-fill, .bl-pin-res.is-studying i { animation: none; } }

/* ------------------------------------------------------------------ the buff list under the portrait */
.bl {
  position: absolute;
  left: 2px;
  top: 142px;
  width: 340px;
  pointer-events: auto;
  font: 600 11.5px/1.2 var(--cx-font-label);
  color: var(--cx-text-dim);
}
.uf.has-talents .bl, .bl.bl--low { top: 172px; }
.hud.compact .bl { display: none; }
.bl-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 20px;
  padding: 0 8px 0 6px;
  border: 1px solid #000;
  border-radius: 3px;
  color: var(--cx-bone);
  font: 700 11.5px/1 var(--cx-font-label);
  letter-spacing: 0.04em;
  background: #15171a var(--bl-tex);
  box-shadow: 0 0 0 1px #4a3a22, 0 2px 6px rgba(0, 0, 0, 0.55);
  cursor: pointer;
}
.bl-head b { color: #9fe07a; font-weight: 700; }
.bl-head:hover { color: #fff3d0; box-shadow: 0 0 0 1px #8a6a3a, 0 0 6px rgba(255, 170, 80, 0.35); }
.bl-caret { display: inline-grid; transform: rotate(-90deg); transition: transform 0.15s ease; color: #c48a45; }
.bl.is-open .bl-caret { transform: none; }
.bl-rows { display: none; margin-top: 4px; padding: 5px 6px 6px; border: 1px solid #000; border-radius: 3px; background: rgba(12, 13, 15, 0.86) var(--bl-tex); box-shadow: 0 0 0 1px #2e3237, 0 3px 10px rgba(0, 0, 0, 0.6); }
.bl.is-open .bl-rows { display: block; }
.bl-row { display: flex; align-items: center; gap: 6px; }
.bl-row + .bl-row { margin-top: 4px; }
.bl-label { width: 78px; flex: none; font: 700 10px/1 var(--cx-font-label); letter-spacing: 0.06em; text-transform: uppercase; color: #8d8577; }
.bl-wells { display: flex; flex-wrap: wrap; gap: 3px; flex: 1; min-width: 0; }
.bl-tile {
  position: relative;
  width: 19px; height: 19px;
  padding: 2px;
  box-sizing: border-box;
  border-radius: 2px;
  color: #4d5157;
  background: #101113 var(--bl-tex);
  box-shadow: 0 0 0 1px #000, 0 0 0 2px #26292d;
  opacity: 0.62;
  cursor: help;
}
.bl-tile svg { display: block; }
.bl-tile.is-lit { opacity: 1; background-color: #1d1a14; box-shadow: 0 0 0 1px #000, 0 0 0 2px #8a6a3a; }
.bl-tile.is-lit.tone-gold { color: #f0c24a; }
.bl-tile.is-lit.tone-blue { color: #7fb2ff; }
.bl-tile.is-lit.tone-green { color: #8fdc6a; }
.bl-tile.is-lit.tone-teal { color: #6fd6c8; }
.bl-tile.is-lit.tone-brown { color: #d9a46a; }
.bl-tile.is-lit.tone-ember { color: #ff8a3d; }
.bl-tile.is-lit.tone-violet { color: #b48cff; }
.bl-tile.is-lit.tone-red { color: #ff6a5a; }
.bl-tile.is-lit.tone-bone { color: #e8dcc4; }
.bl-tile.is-lit.tone-steel { color: #b9c3cf; }
.bl-tile:hover { opacity: 1; box-shadow: 0 0 0 1px #000, 0 0 0 2px #c48a45; }
.bl-say { font: 400 11px/1 var(--cx-font-body); color: #9c9486; margin-left: 4px; }

/* ------------------------------------------------------------------ the pinned frame over the books and the writer */
.bl-pin {
  position: fixed;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 996;                 /* over the books (950) and the writer (995); under dialogs (1000) and tooltips (5000) */
  display: none;
  align-items: flex-start;
  gap: 8px;
  height: 22px;
  padding: 2px 8px;
  border: 1px solid #000;
  border-radius: 3px;
  background: #121315 var(--bl-tex);
  box-shadow: 0 0 0 1px #4a3a22, 0 3px 10px rgba(0, 0, 0, 0.6);
  font: 700 11.5px/18px var(--cx-font-label);
  color: var(--cx-bone);
  pointer-events: auto;
}
.bl-pin.is-on { display: inline-flex; }
.bl-pin-name { white-space: nowrap; cursor: help; }
.bl-pin-bar { position: relative; width: 70px; height: 8px; margin-top: 5px; border: 1px solid #000; background: #0b0c0d; box-shadow: 0 0 0 1px #3a3f46; cursor: help; }
.bl-pin-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: #3f8f37; }
.bl-pin-res { width: 90px; height: 10px; margin-top: 4px; }
.bl-pin-res i { background: #c99a2a; }
.bl-pin-res em { position: absolute; inset: 0; font: 700 9.5px/10px var(--cx-font-num); font-style: normal; text-align: center; color: #fff3d0; text-shadow: 0 1px 0 #000; }
.bl-pin .bl { position: relative; left: auto; top: auto; width: auto; }
.bl-pin .bl-head { height: 18px; }
.bl-pin .bl-rows { position: absolute; right: 0; top: 20px; width: 340px; }

/* ------------------------------------------------------------------ the card pause (js/ui-cardtime.js) */
.ct-note {
  position: absolute;
  left: 50%; bottom: 10px;
  transform: translateX(-50%);
  z-index: 8;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid #000;
  border-radius: 3px;
  background: #17181b var(--bl-tex);
  box-shadow: 0 0 0 1px #8a6a3a, 0 4px 12px rgba(0, 0, 0, 0.6);
  color: var(--cx-bone);
  font: 600 13px/1.2 var(--cx-font-body);
  pointer-events: auto;
}
.ct-note.is-on { display: inline-flex; }
.ct-note button { font: 700 12px/1 var(--cx-font-label); padding: 5px 9px; border: 1px solid #000; border-radius: 3px; color: #fff3d0; background: #4a3416; box-shadow: 0 0 0 1px #c48a45; cursor: pointer; }
.ct-note button:hover { background: #5c4220; }
.ct-veil {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: none;
  place-items: center;
  background: rgba(8, 9, 10, 0.72);
  cursor: pointer;
  pointer-events: auto;
}
.ct-veil.is-on { display: grid; }
.ct-veil-box { padding: 14px 18px; text-align: center; border: 1px solid #000; border-radius: 4px; background: #17181b var(--bl-tex); box-shadow: 0 0 0 1px #8a6a3a, 0 6px 18px rgba(0, 0, 0, 0.7); color: var(--cx-bone); max-width: 340px; }
.ct-veil-box b { display: block; font: 700 16px/1.3 var(--cx-font-head); color: #f0c24a; margin-bottom: 4px; }
.ct-veil-box span { font: 400 13px/1.35 var(--cx-font-body); color: var(--cx-text-dim); }
.ct-clock {
  position: absolute;
  right: 26px; top: 236px;   /* the card's empty right side, clear of the header's buttons */
  z-index: 8;
  display: none;
  gap: 4px;
  align-items: center;
  padding: 2px 6px;
  border: 1px solid #000;
  border-radius: 3px;
  background: #121315 var(--bl-tex);
  box-shadow: 0 0 0 1px #3a3f46;
  font: 700 12px/16px var(--cx-font-num);
  color: #e8dcc4;
  cursor: help;
  pointer-events: auto;
}
.ct-clock.is-on { display: inline-flex; }
.ct-clock.is-ask { color: #f0c24a; box-shadow: 0 0 0 1px #8a6a3a; }
.ct-clock svg { width: 12px; height: 12px; }

/* ------------------------------------------------------------------ fixer r56: the pinned frame reserves its strip
 * (critic r56 S6, play critic S4 + small; the lead: "one rule: the frame reserves its strip; windows start below it"). The pin
 * stands in the top 3-31 px; every full-screen book and the writer start below --bl-strip (the books lose only what the slim
 * margin did not already give: --bl-room), so the pin never covers a book's top edge, tabs or title. */
:root { --bl-strip: 34px; --bl-room: max(0px, calc(var(--bl-strip) - var(--bk-gut, 12px))); --bl-room-s: 30px; }
.nk-layer .nk { height: calc(100vh - 2 * var(--bk-gut) - var(--bl-room)); margin-top: var(--bl-room); }
.az-layer .az { height: calc(100vh - 2 * var(--bk-gut) - var(--bl-room)); margin-top: var(--bl-room); }
.book-layer.lp-book .book { height: calc(100vh - 2 * var(--bk-gut) - var(--bl-room)); margin-top: var(--bl-room); }
.nk-layer.is-small .nk, .az-layer.is-small .az, body.sq-compact .az-layer .az { margin-top: 0; }
.book-layer.lp-book.is-single .book { margin-top: 0; }
/* a small window (one page, below ~980 x 600) keeps every pixel for the book: no strip there, and the pin stays hidden over it */
body:has(.nk-layer.is-small.is-open, .az-layer.is-small.is-open, .book-layer.lp-book.is-single) .bl-pin { display: none; }
.ac-layer { padding-top: max(clamp(8px, 1.1vw, 18px), var(--bl-strip)); }
.wr-root { padding-top: var(--bl-strip); }
/* the writer inside the Nauka: its tab band and the writer move down below the strip (no empty gap inside the writer) */
.wr-root.wr-innauka { padding-top: 0; top: calc(34px + var(--bl-strip)); }
.wnk-band { top: var(--bl-strip); }

/* fixer r56: rested in the head while the pool lasts (the moon blue of its tile) */
.bl-head .bl-rest { font-weight: 600; color: var(--cx-text-dim); white-space: nowrap; }
.bl-head .bl-rest b { color: #8fc3ff; }
/* fixer r56: the Pesak Glass's countdown sits in the card's header, before its tags (CONCEPT, NEW) */
.st-tags > .ct-clock { position: static; right: auto; top: auto; margin-right: 8px; vertical-align: middle; }
