/* snt-adventure/history.css -- the marks of the village's record: a note's value (a green pill with a rising
   arrow, or a red notched tag with a falling one) and a clue's diamond. Colour, arrow AND shape, so no mark
   depends on hue alone. The designer picked them in the Green try-out (2026-11-09).

   The page that links this sheet supplies --fair, --foul, --card, --paper, --edge and --sc (the editor's
   stylesheet does). Only --clue is new, so only --clue is defined here, with both themes guarded the way
   editor/editor.css guards its own. */
:root { --clue:#355a78; --clue-soft:rgba(53,90,120,.22); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --clue:#8fb3d1; --clue-soft:rgba(143,179,209,.22); } }
:root[data-theme="dark"] { --clue:#8fb3d1; --clue-soft:rgba(143,179,209,.22); }

/* color-mix needs Safari 16.2+. A plain line before it in the same rule is NO fallback: with var() inside, the color-mix
   is taken when the sheet is read and only fails when the colour is worked out, and the property then drops to its
   default. So each rule gives a plain colour (a --*-soft token, worked out for the page's own --card), and the color-mix
   comes in an @supports block below it. tests/test_snt_adventure_api.py reads every color-mix for this. */

/* A note's value: the text is "+2" or a real minus sign (U+2212) and the number, e.g. "−1"; aria-label "up 2" / "down 1". */
.val { display:inline-flex; align-items:center; gap:.32em; font-family:var(--sc); font-size:.98rem; line-height:1.35; padding:.06rem .6rem .06rem .5rem; white-space:nowrap; font-variant-numeric:tabular-nums; vertical-align:baseline; }
.val::before { content:""; display:inline-block; width:.62em; height:.56em; background:currentColor; flex:none; }
.val.up { background:var(--fair); color:var(--card); border-radius:999px; }
.val.up::before { clip-path:polygon(50% 0, 100% 100%, 0 100%); }
.val.down { background:var(--foul); color:var(--card); padding-left:.75rem; padding-right:.75rem; clip-path:polygon(.45rem 0, calc(100% - .45rem) 0, 100% 50%, calc(100% - .45rem) 100%, .45rem 100%, 0 50%); }
.val.down::before { clip-path:polygon(0 0, 100% 0, 50% 100%); }
/* Not the identity header the site's nav menu (auth.js) puts in #brt-nav-menu: that menu styles its own .who. :where keeps the specificity of a bare .who. */
.who:not(:where(#brt-nav-menu *)) { display:inline-flex; align-items:center; gap:.35em; font-family:var(--sc); padding:.05rem .55rem; border:1px solid var(--edge); border-radius:6px; background:var(--paper); white-space:nowrap; }
.diamond { display:inline-block; flex:none; width:.72em; height:.72em; border:2px solid var(--clue); background:var(--clue-soft); transform:rotate(45deg); margin:0 .2em; }
@supports (background: color-mix(in srgb, red 50%, blue)) { .diamond { background:color-mix(in srgb, var(--clue) 22%, transparent); } }

/* The earn pop-up (Green plan Part 4): bargain.js's openRecord builds `.bg-veil#record > .bg-dlg.rec`, the page supplies the veil and
   the dialog frame (bargain.js's own styles). Scoped under .bg-dlg.rec / .meter, so the editor, which links this sheet too, is unchanged.
   The top edge and the button take the kind's colour: --fair for a note that raises, --foul for one that lowers, --clue for a clue. */
.bg-dlg.rec { --rk:var(--accent); }
.bg-dlg.rec.k-up { --rk:var(--fair); }
.bg-dlg.rec.k-down { --rk:var(--foul); }
.bg-dlg.rec.k-clue { --rk:var(--clue, #355a78); }
.bg-dlg.rec { border-top-color:var(--rk); }
.bg-dlg.rec .bg-eyebrow { color:var(--rk); }
.bg-dlg.rec .bg-btn.go { background:var(--rk); border-color:var(--rk); color:var(--card); }
.bg-dlg.rec .rec-row { display:flex; flex-wrap:wrap; align-items:center; gap:.4rem .6rem; }
.bg-dlg.rec .rec-now { font-family:var(--sc); color:var(--muted); }
.bg-dlg.rec .rec-clue { margin:0; display:flex; align-items:center; gap:.5rem; font-size:1rem; }
.bg-dlg.rec .rec-clue .diamond { margin:0 .35em 0 .15em; }
/* The bar: scale +-5, a centre tick, the fill from the centre to the total (left toward "against you", right toward "for you"). */
.bg-dlg.rec .meter { display:grid; gap:.3rem; }
.bg-dlg.rec .meter .m-track { position:relative; height:14px; border-radius:7px; border:1px solid var(--edge); background:var(--paper); overflow:hidden; }
.bg-dlg.rec .meter .m-neg, .bg-dlg.rec .meter .m-pos, .rel-row .m-neg, .rel-row .m-pos { position:absolute; top:0; bottom:0; display:block; width:0; }
.bg-dlg.rec .meter .m-neg, .rel-row .m-neg { right:50%; background:var(--foul); }
.bg-dlg.rec .meter .m-pos, .rel-row .m-pos { left:50%; background:var(--fair); }
.bg-dlg.rec .meter .m-tick, .rel-row .m-tick { position:absolute; left:50%; top:-1px; bottom:-1px; width:2px; margin-left:-1px; background:var(--ink); display:block; }
.bg-dlg.rec .meter .m-ends { display:flex; justify-content:space-between; font-family:var(--sc); font-size:.9rem; color:var(--muted); }
@media (prefers-reduced-motion: no-preference) { .bg-dlg.rec .meter .m-neg, .bg-dlg.rec .meter .m-pos { transition:width .7s ease-out; } }
/* The line the story keeps (adventure.html's .noted line): the chips sit beside the words. */
.rec-line .who, .rec-line .val { margin-left:.35em; }
/* A long name wraps inside its chip on a phone instead of running past the pop-up or the line (the base chip is nowrap). */
.rec-row .who, .rec-line .who, .rec-item .who { max-width:100%; white-space:normal; overflow-wrap:anywhere; }
.rec-line .diamond { margin:0 .1em 0 .15em; vertical-align:baseline; }
/* The story line's who and value wrap as a pair, never the value alone (2026-11-12); a long name still wraps inside it. */
.rec-line .rec-pair { display:inline-flex; align-items:baseline; max-width:100%; vertical-align:baseline; }
.rec-line .rec-pair .who { min-width:0; }
/* The same bar on the sheet's relation rows (Task 4.2): no end labels there, the row's aria-label says the side. */
.rel-row .m-track { grid-column:1 / -1; position:relative; display:block; height:12px; border-radius:6px; border:1px solid var(--edge); background:var(--paper); overflow:hidden; }
.rec-new { white-space:nowrap; }
/* The diamond on a choice or an ending's line the character's history opened (Task 4.3, spec ruling 29): its own button beside
   the choice (no button in a button), a 44 px target at the row's right end; the choice keeps the rest of the row.
   One card (the designer's pick on the iPad, 2026-11-12): the ROW wears a plain choice's border and background, the choice
   and the diamond inside it wear none, so the diamond reads as part of its choice. Hovering the choice lights the card, as a
   plain choice's edge lights; a choice held while a step is in flight dims the card once (not the choice again inside it). */
.choices > li.opened-row { display:flex; align-items:stretch; gap:0; border:1px solid var(--edge); border-radius:6px; background:var(--card); }
.choices > li.opened-row > .choice { flex:1 1 auto; min-width:0; width:auto; border:0; background:transparent; }
@supports selector(:has(a)) {   /* a Safari before 15.4 keeps the choice's own dimming instead of the card's */
  .choices > li.opened-row:has(> .choice:hover:not(:disabled)) { border-color:var(--accent); }
  .choices > li.opened-row:has(> .choice:disabled) { opacity:.5; }
  .choices > li.opened-row > .choice:disabled { opacity:1; }
}
/* .tipped.opened-mark, never .opened-mark alone: the page's own .tipped reset (no border, no background, cursor help) comes
   later at the same weight and would win. The diamond page test reads the computed border and cursor. The ending line's
   diamond keeps its own box; only the choice card's sits bare inside the card. */
.tipped.opened-mark { flex:none; min-width:44px; min-height:44px; display:inline-flex; align-items:center; justify-content:center; padding:0; border:1px solid var(--edge); border-radius:6px; background:var(--card); cursor:pointer; text-decoration:none; }
.tipped.opened-mark:hover { border-color:var(--clue); }
.choices > li.opened-row > .tipped.opened-mark { border:0; background:transparent; }
.choices > li.opened-row > .tipped.opened-mark:hover .diamond { filter:brightness(1.25); }
.tipped.opened-mark:focus-visible { outline:2px solid var(--clue); outline-offset:2px; }
.tipped.opened-mark .diamond { margin:0; }
.ending .end-row { display:flex; align-items:center; justify-content:center; gap:.5rem; max-width:34rem; margin:0 auto .8rem; }
.ending .end-row .end-line { margin:0; }
/* a scene's line shown only if, put there by the character's history: the words, then the diamond (left-aligned, as the scene reads) */
.scene .line-row { display:flex; align-items:center; gap:.5rem; margin:0 0 .85rem; }
.scene .line-row .if-line { margin:0; flex:1 1 auto; min-width:0; }
/* A side-tale on the home list: the diamond by its title says the character's history opened it. */
.pick strong .diamond { margin:0 .1em 0 .45em; vertical-align:.08em; }

/* The walk map in the rail (the map rail, 2026-11-14): walkrail.js builds it once per tale, as
   #walkrail #walkframe > svg.walkmap > g.cam > g.roads(line.road(.lit)) + g.places(g.place(.here|.next|.far)(.home)(.lit)) + circle.tok,
   with div.walk-go (the busy words) and div.walk-hint (the ◆ legend) over it. Scoped under #walkrail, so the editor, which links
   this sheet too, is unchanged. Two tokens from Okabe-Ito, so nothing leans on red against green: --walk (orange) for the places
   you can walk to, --here (blue) for where you stand. Every colour has a second cue: a lit place has a thick ring and a dotted
   road, your place is filled and ringed by the token, home has a door and the word. */
:root { --walk:#b65f00; --here:#0072b2; --walk-soft:#f3e4d0; --walk-soft2:#e8caa9; }   /* the softs: --walk 16% and 32% into adventure.html's --card, for a browser without color-mix */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --walk:#e69f00; --here:#56b4e9; --walk-soft:#3f2f12; --walk-soft2:#5f450e; } }
:root[data-theme="dark"] { --walk:#e69f00; --here:#56b4e9; --walk-soft:#3f2f12; --walk-soft2:#5f450e; }
#walkrail .walkmap { position:absolute; inset:0; width:100%; height:100%; display:block; overflow:hidden; user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; -webkit-tap-highlight-color:transparent; }
#walkrail .walkmap .road { stroke:var(--edge); stroke-width:3; stroke-linecap:round; }
#walkrail .walkmap .road.lit { stroke:var(--walk); stroke-width:3.5; stroke-dasharray:1 7; }
#walkrail .walkmap .dot { fill:var(--card); stroke:var(--edge); stroke-width:2; }
#walkrail .walkmap .label { font-family:var(--sc); font-size:14px; fill:var(--muted); text-anchor:middle; stroke:var(--card); stroke-width:4px; stroke-linejoin:round; paint-order:stroke; }   /* the halo: a road under a label never strikes through its words */
#walkrail .walkmap .far { opacity:.6; }
#walkrail .walkmap .next .dot { stroke:var(--walk); stroke-width:4; fill:var(--walk-soft); }
@supports (fill: color-mix(in srgb, red 50%, blue)) { #walkrail .walkmap .next .dot { fill:color-mix(in srgb, var(--walk) 16%, var(--card)); } }
#walkrail .walkmap .next .label, #walkrail .walkmap .here .label { fill:var(--ink); }
#walkrail .walkmap .here .dot { fill:var(--here); stroke:var(--card); stroke-width:2.5; }
#walkrail .walkmap .here.lit .dot { stroke:var(--walk); stroke-width:4; }
#walkrail .walkmap .door { fill:var(--fair); stroke:var(--card); stroke-width:1.2; }
#walkrail .walkmap .knob { fill:var(--card); }
/* on the blue dot you stand on, the green door was lost (contrast 1.1 light, 1.0 dark): there it is the card's own colour with a
   blue knob (the designer's pick A, 2026-11-15). Elsewhere home keeps its green door, as a card door on a card dot would vanish. */
#walkrail .walkmap .here .door { fill:var(--card); stroke:none; }
#walkrail .walkmap .here .knob { fill:var(--here); }
#walkrail .walkmap .homeword { font-style:italic; fill:var(--fair); }
#walkrail .walkmap .hit { fill:transparent; }
#walkrail .walkmap .label { pointer-events:none; }   /* the frame's pointerup decides a tap by where it lands (walkrail.js pickAt); the words and circles only give the cursor */
#walkrail .walkmap .lit { cursor:pointer; }
#walkrail .walkmap .place:not(.lit) { pointer-events:none; }
#walkrail .walkmap .opened { fill:var(--clue); }
#walkrail .walkmap .lit:focus { outline:none; }
#walkrail .walkmap .lit:focus-visible .dot { stroke:var(--ink); stroke-width:4; }
@media (hover:hover) {
  #walkrail .walkmap .next:hover .dot { fill:var(--walk-soft2); }
  @supports (fill: color-mix(in srgb, red 50%, blue)) { #walkrail .walkmap .next:hover .dot { fill:color-mix(in srgb, var(--walk) 32%, var(--card)); } }
}
/* the reveal (secret doors part 2, Task D): a place the walk brings in blooms from its dot. The scale is on g.bloom (it holds the dot,
   the words and the marks; walkrail.js sets its transform-origin to the dot), NEVER on g.place or anything a transform attribute places:
   a CSS transform there flings it to the origin. Reduced motion never adds .blooming, and the rule here says it again. */
#walkrail .walkmap .bloom.blooming { animation:walkbloom .35s ease-out; }
@keyframes walkbloom { from { transform:scale(.15); opacity:0; } to { transform:scale(1); opacity:1; } }
@media (prefers-reduced-motion: reduce) { #walkrail .walkmap .bloom.blooming { animation:none; } }
/* the keyhole by a found place's dot: a shape of its own, so the mark never rests on colour (ink with a card halo, both themes) */
#walkrail .walkmap .keyhole { fill:var(--ink); stroke:var(--card); stroke-width:1.2; paint-order:stroke; stroke-linejoin:round; }
/* the token: a blue ring round where you stand (it walks the road on a move); it never takes a tap */
#walkrail .walkmap .tok { fill:none; stroke:var(--here); stroke-width:3.5; pointer-events:none; }
#walkrail .walkmap .tok.pulse { animation:walkpulse .6s ease-out 2; }
@keyframes walkpulse { 50% { opacity:.3; } }
/* a scene with no place: you stay marked where you last were, the map dimmed a little */
#walkrail.away .walkmap { opacity:.6; }
/* a step on its way (walkrail.js setBusy): the map dims and takes no tap; the words carry it too, not the dim alone */
#walkrail.busy .walkmap { opacity:.5; cursor:progress; }
#walkrail.busy .walkmap .lit { pointer-events:none; }
#walkrail .walk-go { position:absolute; left:50%; top:8px; transform:translateX(-50%); padding:.1rem .65rem; border:1px solid var(--edge); border-radius:999px; background:var(--paper); color:var(--muted); font-size:.85rem; white-space:nowrap; pointer-events:none; }
#walkrail .walk-go:empty { display:none; }
/* "New on your map: X" under the heading (walkrail.js): a polite live region, empty until a step shows a place the map did not */
#walkrail .walk-new { padding:.15rem .75rem .25rem; color:var(--muted); font-size:.9rem; font-style:italic; }
#walkrail .walk-new:empty { display:none; }
/* a folded strip: heard, not drawn (the star says it). The fold hides the map only on a narrow page that is not short and side-on
   (adventure.html's own fold rules), so the line hides only there too: a fold kept from a narrow screen leaves it drawn elsewhere */
@media (max-width: 899.98px) { #walkrail.folded .walk-new { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; padding:0; } }
@media (orientation: landscape) and (max-height: 540px) and (min-width: 560px) {
  #walkrail.folded .walk-new { position:static; width:auto; height:auto; overflow:visible; clip:auto; white-space:normal; padding:.15rem .75rem .25rem; }
}
#walkrail .walk-hint { position:absolute; left:6px; bottom:6px; padding:.05rem .5rem; border-radius:6px; background:var(--card); color:var(--muted); font-style:italic; font-size:.85rem; pointer-events:none; }
#walkrail .walk-hint[hidden] { display:none; }

