/* ═══════════════════════════════════════════════════════════════════════════════════════════════════
   DESKTOP, TIER THREE (2026-10-15, sheets): THE READING SHEETS AND THE LIFE'S BIG SCREENS AT A
   MONITOR'S SIZE (audit SCR-06, SCR-10, SCR-11 and the rest of CH-12). Loaded after desktop-polish.css.
   Same rules as desktop.css: one gutter (--hud-inset), one px scale, nothing centred for a thumb,
   every control names its key with <kbd class="hk">.
   - The character sheet is three columns and the journal two, under one head with Close (Esc) in it.
     The card never scrolls; a column that is longer than the screen scrolls by itself.
   - The arc checkpoint is one screen: its offers side by side, numbered, the way on in view.
   - The threshold keeps its single witness card, centred on the screen, its two choices numbered.
   - The ending is one screen in two columns with its buttons in view; Enter or Space tells all of it.
   - The book a player finds rises in the side panel over the standing world.
   - The sign-in card and the scene loading screen stand in the middle of the screen, not at the top of a page.
   Measured at 1920x1080 and 1366x768 by scripts/_desk-sheets-probe.mjs and _desk-sheets-pages-probe.mjs (untracked
   scratch); the numbers are beside each part.
   ═══════════════════════════════════════════════════════════════════════════════════════════════════ */

/* ---- the reading sheets: a head, then columns that scroll one at a time ----------------------- */
/* measured before at 1920x1080: the character card 980x886 scrolling 1701 (a fresh life) and 2333 (a seasoned one,
   probe-made: 24 signs, 8 people, 3 forged traits, 3 books, a ward), the journal 920x886 scrolling 2084. After: the
   character card 1560 wide in three columns (476, 547, 476) with no scroller for either life; the journal 1240 wide
   in two (524, 654), only the signs column scrolling (1768 in 887). At 1366x768 the card is 1318x720 and each column
   that is longer than 607 scrolls by itself.
   (Close comes second in the markup, so Tab reaches it first; below 1100px it sits in the card's corner) */
#character .modal-card, #journal .modal-card { position: relative; }
/* (the journal's items keep the 12px between them that .journal-list gave them before they had columns to sit in) */
#journal .sheet-col { display: flex; flex-direction: column; gap: 12px; }
.modal .sheet-close { display: inline-flex; align-items: center; margin: 0; padding: 6px 12px 6px 8px; font-size: 13px; min-height: 0; }
.modal .sheet-close kbd.hk { margin-right: 8px; }
@media (max-width: 1099px) {
  .modal .sheet-close { position: absolute; top: 24px; right: 26px; }
}
@media (min-width: 1100px) {
  #character .modal-card, #journal .modal-card {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: start; box-sizing: border-box;
    max-height: calc(100vh - 2 * var(--hud-inset)); overflow: hidden; padding: 22px 30px 24px;
  }
  #character .modal-card { width: min(1560px, calc(100vw - 2 * var(--hud-inset))); max-width: none; grid-template-rows: auto minmax(0, 1fr); }
  #journal .modal-card { width: min(1240px, calc(100vw - 2 * var(--hud-inset))); max-width: none; grid-template-rows: auto auto minmax(0, 1fr); }
  /* the heading's rule runs the card's width and Close stands at its right end, in the same row */
  #character .modal-card > h2, #journal .modal-card > h2 { grid-column: 1 / -1; grid-row: 1; margin: 0; padding-right: 120px; }
  .modal .sheet-close { grid-column: 2; grid-row: 1; align-self: start; justify-self: end; margin-top: 2px; }
  #journal .modal-card > p.muted { grid-column: 1 / -1; margin: 10px 0 0; font-size: 14px; }
  #character-body, #journal-list { grid-column: 1 / -1; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr); gap: 0; margin: 16px 0 0; }
  #character-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr); }
  #journal-list { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
  .modal .sheet-col {
    min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 26px;
    scrollbar-width: thin; scrollbar-color: rgba(217,184,102,0.35) transparent;
  }
  .modal .sheet-col:first-child { padding-left: 0; }
  .modal .sheet-col:last-child { padding-right: 6px; }
  .modal .sheet-col + .sheet-col { border-left: 1px solid rgba(165,142,89,0.2); }
  .modal .sheet-col > .char-block:last-child { margin-bottom: 0; }
  #journal .jcol-h { margin: 0; }
  #journal .jcol-h .muted { margin-left: 6px; letter-spacing: 0.06em; }
  #journal .settled + .jcol-h { margin-top: 10px; }
  #journal .journal-empty { margin: 0; }
}

/* ---- the turning (the arc checkpoint): one screen, its offers side by side ----------------------- */
/* measured before at 1920x1080: a 620px column at x 650, the offers 620x133, 620x154, 620x133 and the decline 620x68,
   stacked; place:false. Here the screen is the viewport (the page) or the plate widened to it (over a standing place),
   the head centred over a row of cards up to 1320px wide, the decline a quiet row under them, all in view at 1080.
   After: the three offers 431x191 side by side at y 557 and the decline 1320x46 at y 761 (1920x1080); 430x208 at
   y 391 and the decline at y 614 (1366x768). */
.checkpoint {
  position: fixed; inset: 0; z-index: 20; box-sizing: border-box; max-width: none; margin: 0;
  padding: 72px var(--hud-inset) 40px; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; align-items: center; justify-content: safe center;
  background: radial-gradient(90% 80% at 50% 42%, rgba(16,22,24,0.93), rgba(6,8,10,0.98));
  outline: none;
}
.place-plate .checkpoint { position: absolute; }
/* SKEPTIC (2026-10-15): the outgoing turning keeps the whole screen while it fades. swap()'s `.leaving` is
   `position: absolute !important` against the .game column, so on the page the old turning (the trait, on its way to
   the ambition) shrank to a 1180x112 strip at the top of the column at opacity 0.99 while the new one rose from 0 over
   the bare page (measured in the click's own task at 1920x1080 and 1366x768). It stays fixed like the screen it was;
   in the plate the plate is already the screen, so there it stays absolute. */
.checkpoint.leaving { position: fixed !important; bottom: 0 !important; }
.place-plate .checkpoint.leaving { position: absolute !important; }
.hub.place .place-plate:has(> .checkpoint:not(.leaving)) {
  left: 0; right: 0; width: auto; padding: 0; overflow: hidden;
  background: none; border: 0; box-shadow: none; animation: none;
}
body:has(.checkpoint:not(.leaving)) .rail, body:has(.checkpoint:not(.leaving)) .reflection { display: none; }
.hub.place:has(.checkpoint:not(.leaving)) :is(.stage-top, .place-keys, .place-e, .w3-lock, .place-say) { visibility: hidden; }
body:has(.checkpoint:not(.leaving)) { overflow: hidden; }
.checkpoint > * { flex: 0 0 auto; }
.checkpoint h1 { font-family: var(--serif); font-weight: 500; font-size: 40px; line-height: 1.15; margin: 8px 0 0; }
.checkpoint .girih-band { margin: 14px auto 16px; }
.checkpoint .cp-desc { max-width: 68ch; font-size: 18px; margin: 0 0 12px; }
.checkpoint .cp-gain-note, .checkpoint .cp-shift, .checkpoint .cp-carry { max-width: 72ch; margin: 0 0 10px; }
.checkpoint .cp-amb-label { margin: 8px 0 12px; }
/* (a flex row, not an auto-fit grid: the decline spanning 1 / -1 kept a fourth empty track open and the three offers
   were 320px each in a 1320px row) the offers share the first line, the decline takes the whole of the second */
.checkpoint :is(.cp-gains, .cp-ambitions) {
  display: flex; flex-direction: row; flex-wrap: wrap; align-items: stretch; gap: 14px;
  width: min(1320px, 100%); margin: 14px 0 0;
}
.checkpoint :is(.cp-gain, .cp-amb) { flex: 1 1 0; min-width: 260px; }
.checkpoint :is(.cp-gain, .cp-amb).hold { flex: 1 1 100%; }
/* a card: the key, the name beside it, the words under the name, the gift and the cost at the foot */
.checkpoint :is(.cp-gain, .cp-amb):not(.hold) {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto 1fr auto; align-content: start;
  gap: 8px 12px; padding: 20px 22px 18px; min-height: 168px; text-align: left; box-sizing: border-box;
}
.checkpoint .cp-amb:not(.hold) { min-height: 0; }
.checkpoint :is(.cp-gain, .cp-amb) kbd.hk { grid-column: 1; grid-row: 1; margin: 4px 0 0; }
.checkpoint :is(.cp-gain, .cp-amb):not(.hold) b { grid-column: 2; grid-row: 1; font-size: 21px; line-height: 1.25; }
.checkpoint .cp-gain:not(.hold) .cpg-desc, .checkpoint .cp-amb:not(.hold) > span { grid-column: 2; grid-row: 2; margin: 0; font-size: 14.5px; line-height: 1.55; }
.checkpoint .cp-gain:not(.hold) .cpg-eff { grid-column: 2; grid-row: 3; align-self: end; margin-top: 6px; }
.checkpoint .cp-gain .cpg-eff :is(.cpg-buff, .cpg-debuff) { border-radius: 9px; line-height: 1.4; }
/* the decline: one quiet row across the foot of the cards */
.checkpoint :is(.cp-gain, .cp-amb).hold {
  display: flex; align-items: center; gap: 12px; padding: 12px 18px; text-align: left;
  background: transparent; border: 1px dashed rgba(233,220,196,0.18); border-left-width: 1px; opacity: 0.85;
}
.checkpoint :is(.cp-gain, .cp-amb).hold kbd.hk { margin: 0; }
.checkpoint :is(.cp-gain, .cp-amb).hold b { display: inline; font-size: 16px; }
.checkpoint :is(.cp-gain, .cp-amb).hold :is(.cpg-desc, span) { display: inline; margin: 0; font-size: 13.5px; color: var(--ink-dim); }
/* the focused card reads as the hovered one (Tab or the arrows put it there; Enter takes it) */
.checkpoint :is(.cp-gain, .cp-amb):focus { outline: none; }
.checkpoint :is(.cp-gain, .cp-amb):focus-visible, .checkpoint :is(.cp-gain, .cp-amb):hover {
  border-color: var(--gold); transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.3), 0 0 0 1px color-mix(in srgb, var(--gold) 32%, transparent);
}
.checkpoint :is(.cp-gain, .cp-amb).hold:is(:focus-visible, :hover) { opacity: 1; border-style: solid; }

/* ---- the threshold: the one witness card, in the middle of the screen ------------------------- */
/* measured before at 1920x1080: 600x477 at (660, 96), the buttons unkeyed. The card keeps its measure (a prayer
   card, not a column); it is centred in the viewport rather than hung from the top of the page: 600x477 at (660, 301). */
.shahada { position: fixed; inset: 0; z-index: 20; margin: auto; width: min(600px, calc(100vw - 2 * var(--hud-inset))); height: fit-content; max-height: calc(100vh - 2 * var(--hud-inset)); overflow-y: auto; box-sizing: border-box; padding: 0 4px; }
body:has(.shahada), body:has(.stillness), body:has(.ending) { overflow: hidden; }
.shahada .reveal-actions .btn { display: inline-flex; align-items: center; }
/* the beat between: the one point of light in the middle of the screen, not of a 60vh box under the site row */
.stillness { position: fixed; inset: 0; z-index: 20; min-height: 0; }

/* ---- the ending: one screen, two columns, the buttons always in view ------------------------- */
/* measured before at 1920x1080 for a seasoned life: .ending 720x2714 at x 600, the document 2956 tall, "Live another
   life" at y 2642. Here: the head across the top, how it ended and what you had become on the left, what you meant,
   the road, how you were known and the verdict on the right, each column scrolling by itself, the foot pinned.
   After, the same life: two 688px columns from y 145, the right one 1466 tall scrolling in 860, the foot at y 1005 and
   "Live another life" at (1498, 1020); no page scroll. At 1366x768: two 627px columns in 571, the foot at y 693. */
.ending {
  position: fixed; inset: 0; z-index: 20; box-sizing: border-box; max-width: none; margin: 0;
  padding: 56px var(--hud-inset) 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; justify-items: center;
  text-align: left; outline: none;
}
.ending > * { width: min(1440px, 100%); }
.ending .ending-head { text-align: center; padding: 8px 0 10px; }
.ending .ending-head h1 { font-size: 40px; }
.ending .end-cols { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 0 64px; }
.ending .end-col {
  min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 10px 28px 0;
  scrollbar-width: thin; scrollbar-color: rgba(217,184,102,0.35) transparent;
}
.ending .end-mv { padding: 22px 0 4px; }
.ending .end-col > .end-mv:first-child { padding-top: 4px; }
.ending .end-mv .mv-label { margin: 10px 0 12px; }
.ending .end-arrival { font-size: 20px; }
.ending .ending-how { margin: 2px 0 6px; }
.ending .ending-trait { max-width: none; margin: 0 0 12px; }
.ending .growth { margin: 2px 0 14px; }
.ending .growth-row { padding: 7px 0; }
.ending .ending-path { margin: 10px 0 6px; }
.ending .amb-recaps { max-width: none; margin: 4px 0; }
.ending .amb-recap { padding: 10px 0; }
.ending .ending-rep { margin: 6px 0; }
/* the verdict keeps its own centred measure inside the column: it comes last and alone */
.ending .mv-verdict { text-align: center; padding-top: 30px; }
.ending .mv-verdict .mv-rule { background: linear-gradient(90deg, transparent, var(--gold-dim) 50%, transparent); }
.ending .mv-star { margin: 2px 0 14px; }
.ending .mv-star svg { width: 64px; height: 64px; }
.ending .ending-body { max-width: 60ch; margin: 0 auto 18px; font-size: 18px; }
.ending .ending-verse { margin: 0 auto 12px; }
.ending .ending-closing { margin-top: 18px; }
/* the foot: the key line on the left, the buttons on the right */
.ending .end-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 14px 0 18px; border-top: 1px solid rgba(198,220,214,0.12); }
.ending .end-actions { margin: 0 0 0 auto; justify-content: flex-end; }
.ending .end-actions .btn { display: inline-flex; align-items: center; }
.ending .end-skip { margin: 0; text-align: left; letter-spacing: 0.1em; }
.ending .end-skip kbd.hk { letter-spacing: 0.02em; }
/* once the buttons have arrived the whole has been told, and the line saying how to hurry it stands down */
.ending.arrived .end-skip { visibility: hidden; }
/* (style.css's told list leaves the road's lines out, so after a tell-all they still arrived one by one at 7.1s and on) */
.ending.told .road-line { animation: none !important; opacity: 1 !important; transform: none !important; }
@media (max-height: 820px) {
  .ending { padding-top: 52px; }
  .ending .ending-head { padding: 2px 0 6px; }
  .ending .ending-head h1 { font-size: 32px; }
  .ending .end-arrival { font-size: 18px; }
}
@media (max-width: 1099px) {
  .ending .end-cols { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
  .ending .end-col { overflow: visible; }
}

/* ---- the book in the side panel ------------------------------------------------------------------ */
.place-plate .reader { max-width: none; margin: 0; padding: 26px 28px 28px; text-align: left; }
.place-plate .reader .book-art { width: 180px; margin: 0 0 16px; }
.place-plate .reader-body, .place-plate .reader-note { max-width: 64ch; margin-left: 0; margin-right: 0; }
.place-plate .reader #readerClose { margin-top: 6px; }
/* SKEPTIC (2026-10-15): over a standing turning the sheet's library rows wait for it to be answered (app.js disables
   them, as it does the perk button); they read as resting, not as broken */
#character .lib-book:disabled, #character .lib-book:disabled:hover { opacity: 0.5; cursor: not-allowed; border-color: var(--line); background: rgba(233,220,196,0.03); }
#character .linkbtn#charPerks:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---- the sign-in card: one card in the middle of the screen, over the title's own picture ---------- */
/* measured before at 1920x1080: a 460x468 card at (730, 180) hung under a 70px site row in the 1180 column, the
   rest of the screen the page's pattern. The landing and the step after it are full-screen pictures; this card now
   stands centred over the same picture at low light, the site row kept (Settings and About are on it). */
body:has(.auth-screen) { overflow: hidden; }
body:has(.auth-screen) .game::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(15,23,26,0.92), rgba(15,23,26,0.72) 50%, rgba(15,23,26,0.9)),
    url(opening/road-values-v3.png) right center / cover no-repeat;
}
.auth-screen {
  position: fixed; inset: 0; z-index: 1; margin: auto; height: fit-content; box-sizing: border-box;
  width: min(460px, calc(100vw - 2 * var(--hud-inset))); max-height: calc(100vh - 2 * var(--hud-inset)); overflow-y: auto;
  background: rgba(12,19,22,0.86); border: 1px solid rgba(212,183,127,0.3); box-shadow: 0 24px 70px rgba(0,0,0,0.5);
}
.auth-screen #authGo { display: inline-flex; align-items: center; justify-content: center; }
.auth-screen #authGo kbd.hk { margin-right: 9px; }
.auth-screen .auth-keys { margin: 14px 0 0; font-size: 11.5px; letter-spacing: 0.05em; color: var(--ink-faint); }
.auth-screen .auth-keys kbd.hk { margin-right: 6px; }

/* ---- the scene loading screen: the place's name and its line together, in the middle ------------- */
/* (it wears .opening-choice, which desktop-polish.css made a full-screen grid for one card: three bare children were
   laid out as three rows of 360px each, the name at y 217, the line at 599, Main menu at 921, all under the ::after
   shade; measured at 1920x1080) */
.opening-choice.scene-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.opening-choice.scene-loading > * { position: relative; z-index: 1; margin: 0; }
.opening-choice.scene-loading h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 3.2vw, 46px); letter-spacing: -0.01em; color: #f2e9d9; }
.opening-choice.scene-loading [role="status"] { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: #c9bfa9; }
.opening-choice.scene-loading .btn { margin-top: 18px; }

/* ---- a column with more below it says so: its foot fades while there is more to scroll ------------- */
/* (a scroll-driven animation on the column's own scroll: a column that does not scroll has no timeline and no fade;
   at the end of its scroll the foot's fade lifts so the last line reads whole, and once it has left the top a fade
   there says the column has more above: at 1366x768 the ending's left column follows "what you had become" in by
   50px and its first line was cut hard against the head) */
@property --col-fade { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --col-top { syntax: "<length>"; inherits: false; initial-value: 0px; }
@keyframes col-fade { from { --col-fade: 40px; --col-top: 0px; } 6% { --col-top: 24px; } 94% { --col-fade: 40px; } to { --col-fade: 0px; --col-top: 24px; } }
@supports (animation-timeline: scroll()) {
  .modal .sheet-col, .ending .end-col {
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 var(--col-top), #000 calc(100% - var(--col-fade)), transparent);
    mask-image: linear-gradient(to bottom, transparent, #000 var(--col-top), #000 calc(100% - var(--col-fade)), transparent);
    animation: col-fade linear both; animation-timeline: scroll(self);
  }
}
