/* THE RAVEN 4D6 IS KEPT ON PAPER (Wave 110b).
 * One rules-core, many tables, and every one of them is played on paper. So the world is a rulebook's page:
 * a printed graph-paper ground with a red-pencil margin, printed headings, and one record sheet where the
 * day's throw is pencilled in (scripts/raven-sheet.js). The days behind stand rubbed out in the kept box.
 * The sheet wears as paper does (wear/v0.2, from this room's own record); light is not observed, so it is not
 * yellowed. The dice are drawn as a pencil draws them. Type: a printed geometric face for the form, a book face
 * for the rules, a hand for the pencil. No web fonts. */

body[data-world="raven-4d6"] {
  --bg: #f1ecdf; --surface: #e9e2d0; --surface2: #f7f3e8; --text: #2c2a26; --muted: #6c675d; --dim: #c9c0aa;
  --amber: #2f4f7a; --amber2: #2f4f7a; --ember: #b4392f; --ember-rgb: 180 57 47; --amber2-rgb: 47 79 122;
  --glyph-bg: #f7f3e8; --seal-a: #3a3834; --seal-b: #4a4741;
  --grid: rgb(86 128 176 / .13); --grid-major: rgb(86 128 176 / .22); --graphite: #3d3b37; --print: #1f2b3d;
  --nav-bg: rgba(241, 236, 223, .94);
  --die-body: #fbf8f0; --die-edge: #3d3b37; --die-pip: #3d3b37;
  --f-display: Futura, 'Century Gothic', 'Avenir Next', 'Trebuchet MS', sans-serif;
  --f-label: Futura, 'Century Gothic', 'Avenir Next', 'Trebuchet MS', sans-serif;
  --f-body: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --f-num: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --f-pencil: Noteworthy, 'Bradley Hand', 'Segoe Print', 'Comic Neue', cursive;
  font-family: var(--f-body); font-size: 16px;
  background-color: var(--bg);
  background-image:
    linear-gradient(90deg, transparent 63px, rgb(180 57 47 / .38) 63px, rgb(180 57 47 / .38) 64px, transparent 64px),
    linear-gradient(var(--grid-major) 1px, transparent 1px), linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 100% 100%, 100px 100px, 100px 100px, 20px 20px, 20px 20px;
}
body[data-world="raven-4d6"]::before { opacity: .18; mix-blend-mode: multiply; }

/* the banner: a printed page head, with the record sheet laid on it */
body[data-world="raven-4d6"] .banner-block {
  background: none; border-bottom: 2px solid var(--print); padding: 4.6rem 3rem 3rem 5.4rem;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 470px); grid-template-rows: auto auto 1fr; column-gap: 3rem; align-items: start;
}
body[data-world="raven-4d6"] .banner-block::after { background: none; }
body[data-world="raven-4d6"] .banner-eyebrow { grid-column: 1; color: var(--ember); font-family: var(--f-label); letter-spacing: .34em; }
body[data-world="raven-4d6"] .banner-eyebrow::before { background: var(--ember); }
body[data-world="raven-4d6"] .banner-title { grid-column: 1; font-family: var(--f-display); font-weight: 700; color: var(--print); letter-spacing: -.01em; font-size: clamp(3.2rem, 7.6vw, 6.6rem); }
body[data-world="raven-4d6"] .banner-tagline { grid-column: 1; font-family: var(--f-label); color: var(--muted); letter-spacing: .18em; font-size: .82rem; }

.pencil { font-family: var(--f-pencil); font-weight: 400; font-style: normal; color: var(--graphite); text-shadow: 0 0 .5px rgb(61 59 55 / .6); }

body[data-world="raven-4d6"] .sheet {
  grid-column: 2; grid-row: 1 / span 3; position: relative; overflow: hidden; isolation: isolate;
  transform: rotate(1.4deg); margin-top: -.6rem;
  background-color: #faf6ea; color: var(--print);
  border: 1px solid #b9ae94; box-shadow: 0 1px 0 #fff inset, 0 14px 26px -14px rgb(60 48 24 / .45), 0 2px 4px rgb(60 48 24 / .12);
  padding: 1.1rem 1.3rem 1rem; font-family: var(--f-label);
}
/* wear/v0.2 paper: foxing by age, a thumb and a turned corner by handling, a film by dust (absent vars draw nothing) */
body[data-world="raven-4d6"] .sheet::before, body[data-world="raven-4d6"] .sheet::after { content: ''; position: absolute; inset: 0; pointer-events: none; }
body[data-world="raven-4d6"] .sheet::before { background: var(--wear-foxing, none); z-index: 0; }
body[data-world="raven-4d6"] .sheet::after { z-index: 3;
  background:
    radial-gradient(ellipse 30% 22% at 96% 96%, rgb(70 52 30 / calc(var(--wear-handled, 0) * .3)), transparent 70%),
    linear-gradient(135deg, transparent calc(100% - var(--wear-handled, 0) * 26px), #e2d8bf calc(100% - var(--wear-handled, 0) * 26px)),
    linear-gradient(rgb(120 112 98 / calc(var(--wear-dust, 0) * .22)), rgb(120 112 98 / calc(var(--wear-dust, 0) * .22)));
}
body[data-world="raven-4d6"] .sheet > * { position: relative; z-index: 2; }
.sh-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-bottom: .5rem; border-bottom: 2px solid var(--print);
  font-size: .64rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 700; }
.sh-head .pencil { font-size: 1.15rem; letter-spacing: 0; text-transform: none; margin-left: .3rem; }
.sh-grid { display: grid; grid-template-columns: minmax(0, 1fr) 8.6rem; grid-template-areas: 'day kept' 'faces kept' 'took kept'; border-left: 1px solid var(--print); }
.sh-day { grid-area: day; } .sh-took { grid-area: took; }
.sh-field { margin: 0; padding: .45rem .6rem .5rem; border-right: 1px solid var(--print); border-bottom: 1px solid var(--print); min-height: 4.2rem; display: flex; flex-direction: column; gap: .2rem; }
.sh-lab { font-size: .56rem; letter-spacing: .18em; text-transform: uppercase; color: #4d5868; }
.sh-field > .pencil { font-size: 1.5rem; line-height: 1.1; }
.sh-faces { grid-area: faces; }
.sh-boxes { display: flex; gap: .6rem; }
.sh-boxes i { display: inline-flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem; border: 1.5px solid var(--print); font-size: 1.6rem; font-style: normal; position: relative; }
.sh-boxes i.is-taken::after { content: ''; position: absolute; left: -12%; right: -12%; top: 50%; height: 2px; background: var(--graphite); transform: rotate(-24deg); opacity: .8; border-radius: 2px; }
.sh-kept { grid-area: kept; align-items: center; }
.sh-kept .sh-lab { align-self: stretch; }
.sh-ring { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 6.2rem; height: 5rem; margin: auto 0; }
.sh-ring > .pencil { font-size: 3.6rem; line-height: 1; position: relative; z-index: 1; }
.sh-ring::before { content: ''; position: absolute; inset: -4px -2px; border: 1.6px solid var(--graphite); border-radius: 50% 46% 52% 44%; transform: rotate(-6deg); opacity: .75; }
.sh-ghosts i { position: absolute; left: 50%; top: 50%; font: 3rem/1 var(--f-pencil); font-style: normal; color: var(--graphite);
  opacity: var(--ga, .1); filter: blur(.6px); transform: translate(calc(-50% + var(--gx, 0%)), calc(-50% + var(--gy, 0%))) rotate(var(--gr, 0deg)); }
.sh-foot { margin-top: .7rem; font: italic .74rem/1.55 var(--f-body); color: var(--muted); }
.sh-wear { margin-top: .4rem; font: .6rem/1.6 var(--f-num); letter-spacing: .04em; color: #7a7466; }

/* the rest of the page, in print */
body[data-world="raven-4d6"] .relic-glyph { color: var(--print); background: var(--glyph-bg); border: 2px solid var(--print); border-radius: 12px; box-shadow: 4px 4px 0 var(--dim); }
body[data-world="raven-4d6"] .badge { font-family: var(--f-label); font-weight: 700; color: var(--print); }
body[data-world="raven-4d6"] .badge.seal { color: var(--ember); }
body[data-world="raven-4d6"] .badge.eyes { color: var(--muted); }
body[data-world="raven-4d6"] .relic-description { font-style: normal; color: var(--text); border-left-color: var(--ember); }
body[data-world="raven-4d6"] .seal-text { font-family: var(--f-body); }
body[data-world="raven-4d6"] .duty-grid { background: var(--print); }
body[data-world="raven-4d6"] .duty-cell { background: var(--surface2); }
body[data-world="raven-4d6"] .duty-value { color: var(--print); font-weight: 700; }
body[data-world="raven-4d6"] .duty-grid-wrap, body[data-world="raven-4d6"] .back-strip { background: rgb(233 226 208 / .7); }
body[data-world="raven-4d6"] .log-paper { transform: rotate(-.6deg); border-left: 3px solid var(--ember); background: #faf6ea; box-shadow: 0 10px 22px -12px rgb(60 48 24 / .4); }
body[data-world="raven-4d6"] .log-paper::before { background: radial-gradient(circle at 35% 35%, #d9534a, #8f2a22 70%); }
body[data-world="raven-4d6"] .log-eyebrow-name { font-family: var(--f-label); font-weight: 700; text-transform: uppercase; letter-spacing: .2em; color: var(--print); }
body[data-world="raven-4d6"] .log-date { color: var(--ember); font-family: var(--f-num); }
body[data-world="raven-4d6"] .log-body { font-family: var(--f-body); }
body[data-world="raven-4d6"] .log-entry { border-top-color: var(--dim); }
body[data-world="raven-4d6"] .redact-note { color: var(--muted); }
body[data-world="raven-4d6"] .btn-primary { color: var(--surface2); background: var(--print); }
body[data-world="raven-4d6"] .btn-primary:hover { background: var(--ember); }
body[data-world="raven-4d6"] .ws-engine { color: var(--muted); }
body[data-world="raven-4d6"] footer { border-top: 2px solid var(--print); }

/* the day's throw room: dice drawn in pencil on the page */
body[data-world="raven-4d6"] .rt-die rect { stroke-width: 2; }
body[data-world="raven-4d6"] .rt-die { filter: drop-shadow(2px 3px 0 rgb(60 48 24 / .12)); }
body[data-world="raven-4d6"] .rt-die.is-taken { opacity: .5; }
body[data-world="raven-4d6"] .rt-die.is-taken rect { stroke: var(--muted); }
body[data-world="raven-4d6"] .rt-die.is-taken circle { fill: var(--muted); }
body[data-world="raven-4d6"] .rt-sum { font-family: var(--f-pencil); color: var(--graphite); font-size: 3rem; letter-spacing: 0; }
body[data-world="raven-4d6"] .rt-past { border-color: var(--print); background: var(--surface2); }
body[data-world="raven-4d6"] .rt-past b { font-family: var(--f-pencil); color: var(--graphite); }
body[data-world="raven-4d6"] .rt-throw { font-family: var(--f-label); font-weight: 700; color: var(--print); background: var(--surface2); border: 2px solid var(--print); }
body[data-world="raven-4d6"] .rt-throw:hover, body[data-world="raven-4d6"] .rt-throw:focus-visible { color: var(--ember); border-color: var(--ember); }
body[data-world="raven-4d6"] .rt-moves a, body[data-world="raven-4d6"] .rt-door a { color: var(--amber); border-bottom-color: rgb(var(--amber2-rgb) / .5); }
body[data-world="raven-4d6"] .rt-recipe code { color: var(--print); }

/* the entrance, the kit and the shell, read in print */
body[data-world="raven-4d6"] .entrance .en-scene { color: var(--text); font-family: var(--f-body); }
body[data-world="raven-4d6"] .entrance .en-scene::first-letter { color: var(--ember); font-family: var(--f-display); font-weight: 700; }
body[data-world="raven-4d6"] .entrance .en-arrive, body[data-world="raven-4d6"] .entrance .en-tuned { color: var(--muted); font-family: var(--f-num); }
body[data-world="raven-4d6"] .en-tuned b { color: var(--ember); font-family: var(--f-display); }
body[data-world="raven-4d6"] .en-ways button, body[data-world="raven-4d6"] .entrance .en-ways a { color: var(--print); font-family: var(--f-label); font-weight: 700; background: var(--surface2); border-color: var(--print); }
body[data-world="raven-4d6"] .en-ways button:hover, body[data-world="raven-4d6"] .entrance .en-ways a:hover { color: var(--ember); border-color: var(--ember); }
body[data-world="raven-4d6"] .entrance .en-ways .en-next { color: var(--muted); border-color: var(--dim); }
body[data-world="raven-4d6"] .walk-card { background: var(--surface2); border-color: var(--print); color: var(--text); }
body[data-world="raven-4d6"] .walk-card .wk-line { color: var(--text); }
body[data-world="raven-4d6"] .relic-web { background: var(--surface); }
body[data-world="raven-4d6"] .bk-btn { background: var(--surface2); }
body[data-world="raven-4d6"] .plate-frame { border-color: var(--print); background: var(--surface2); }
body[data-world="raven-4d6"] nav:first-of-type, body[data-world="raven-4d6"] .world-nav { background: var(--nav-bg); border-bottom-color: var(--print); }
body[data-world="raven-4d6"] .world-nav { font-family: var(--f-label); font-weight: 700; --w-accent: var(--ember) !important; --w-accent2: var(--print) !important; }
body[data-world="raven-4d6"] .world-nav a, body[data-world="raven-4d6"] .nav-back { color: var(--muted); }
body[data-world="raven-4d6"] .nav-brand, body[data-world="raven-4d6"] .footer-brand { color: var(--print); font-family: var(--f-display); font-weight: 700; }
body[data-world="raven-4d6"] .nav-ticker { color: var(--ember); font-family: var(--f-label); font-weight: 700; }
body[data-world="raven-4d6"] .world-room-head .wr-no { font-family: var(--f-display); color: var(--dim); font-weight: 700; }
body[data-world="raven-4d6"] .world-room-head h2 { font-family: var(--f-display); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
body[data-world="raven-4d6"] .world-room-head p, body[data-world="raven-4d6"] .ws-no small, body[data-world="raven-4d6"] .ws-empty,
body[data-world="raven-4d6"] .ws-count, body[data-world="raven-4d6"] .world-record-head, body[data-world="raven-4d6"] .wl-head,
body[data-world="raven-4d6"] .world-lede, body[data-world="raven-4d6"] .wl-row { color: var(--muted); }
body[data-world="raven-4d6"] .ws-body { color: var(--text); }
body[data-world="raven-4d6"] .ws-no { font-family: var(--f-display); font-weight: 700; }
body[data-world="raven-4d6"] .ws-chapter, body[data-world="raven-4d6"] .wl-row { border-top-color: var(--dim); }
body[data-world="raven-4d6"] .world-record-head, body[data-world="raven-4d6"] .wl-row, body[data-world="raven-4d6"] .ws-no small { font-family: var(--f-num); }
body[data-world="raven-4d6"] .surface-dust, body[data-world="raven-4d6"] .street-chalk { max-width: 100%; overflow-wrap: anywhere; }

@media (max-width: 860px) {
  body[data-world="raven-4d6"] .banner-block { display: block; padding: 3.6rem 16px 2.4rem 16px; }
  body[data-world="raven-4d6"] .sheet { margin-top: 1.8rem; transform: rotate(.8deg); }
  body[data-world="raven-4d6"] { background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px; background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px), linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); }
}
@media (max-width: 560px) {
  body[data-world="raven-4d6"] nav:first-of-type { padding: 1rem 16px; gap: 10px; }
  body[data-world="raven-4d6"] nav:first-of-type .nav-brand { display: none; }
  body[data-world="raven-4d6"] .nav-ticker { font-size: .78rem; letter-spacing: .14em; }
  body[data-world="raven-4d6"] .duty-cell { min-width: 0; padding: 1.4rem .6rem; }
  body[data-world="raven-4d6"] .duty-value { font-size: 1.3rem; overflow-wrap: anywhere; }
  .sh-boxes { gap: .4rem; } .sh-boxes i { width: 2.2rem; height: 2.2rem; font-size: 1.35rem; }
}
