:root {
  --dusk: #1b2129;       /* reading panel */
  --dusk-deep: #13181e;  /* gutter around the painting */
  --paper: #e6dac2;      /* body text, lamp-lit paper */
  --rain: #8b97a4;       /* secondary text */
  --lamp: #e2a95b;       /* the player's hand: their words, their choices */
  --wet: #2d3843;        /* rules and fields */
  --danger: #d98c7a;
  --col: 600px;
  --measure: 34em;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--dusk-deep);
  color: var(--paper);
  font: 300 19px/1.62 "Spectral", Georgia, serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--lamp); outline-offset: 3px; }

/* 3:2 paintings. The text column keeps a readable width (420-600px); the painting fills
   everything else at full height, cropping a sliver at the sides if needed. */
.frame { display: grid; grid-template-columns: minmax(0, 1fr) clamp(420px, calc(100vw - 150vh), 600px); height: 100vh; }

/* ---------- the painting ---------- */
.painting {
  position: relative; margin: 0; background: var(--dusk-deep); height: 100vh;
  display: grid; place-items: center; overflow: hidden;
}
.painting .layer {
  /* Fill the panel, but never trim more than 10% of a 3:2 painting's width:
     the box is never narrower than 1.35:1. Past that, thin bands appear above and below. */
  grid-area: 1 / 1; width: 100%; height: auto; aspect-ratio: 1.35; max-height: 100vh;
  object-fit: cover; object-position: center; opacity: 0; transition: opacity 1.6s ease-in-out;
}
.painting .layer.shown { opacity: 1; }
.painting .layer:not([src]), .painting .layer[src=""] { visibility: hidden; }
.painting .layer.clip { filter: none; transition: opacity 1.2s ease; background: transparent; }
.painting .layer.clip.shown { opacity: 1; }
.painting.playing { cursor: pointer; }
.painting .motion-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.painting .motion-layer.marking { pointer-events: auto; cursor: crosshair; }
.mark-bar { position: absolute; z-index: 5; left: 1rem; right: 1rem; bottom: 1rem; background: rgba(27,33,41,.88); color: var(--paper);
  padding: .6rem .9rem; font-size: .9rem; border: 1px solid var(--wet); display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.mark-bar b { color: var(--lamp); font-weight: 600; }
.mark-bar .size { display: inline-flex; gap: .4rem; align-items: center; color: var(--rain); }
.mark-bar input[type=range] { width: 7rem; accent-color: var(--lamp); }
.mark-bar button { background: none; border: 1px solid var(--wet); color: var(--rain); cursor: pointer; padding: .25rem .6rem; }
.mark-bar button:hover { color: var(--lamp); }
.paint-status {
  position: absolute; bottom: 1.2rem; left: 50%; transform: translateX(-50%);
  font-style: italic; font-size: .85rem; color: var(--rain); letter-spacing: .01em;
}

/* ---------- the column ---------- */
.column { position: relative; background: var(--dusk); display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--wet); }
.bar { display: flex; align-items: baseline; gap: 1rem; padding: .9rem 1.6rem .7rem; border-bottom: 1px solid var(--wet); font-size: .82rem; }
.bar-right { margin-left: auto; display: flex; gap: 1rem; align-items: baseline; flex-wrap: wrap; justify-content: flex-end; }
.bar-right button, .bar-right label { white-space: nowrap; }
.goal { color: var(--lamp); opacity: .8; font-size: .85rem; letter-spacing: .02em; white-space: nowrap; }
.intro { max-width: var(--measure); margin: 0 0 1.6rem; padding-bottom: 1rem; border-bottom: 1px solid var(--wet); }
.intro h2 { font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--lamp); margin: 0 0 .5rem; }
.intro p { font-style: italic; color: var(--paper); margin: 0; }
.where { min-width: 0; color: var(--rain); font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#home-btn { font-weight: 600; letter-spacing: .04em; color: var(--paper); }
.quiet { background: none; border: 0; padding: 0; color: var(--rain); cursor: pointer; }
.quiet:hover { color: var(--paper); }
.bar { flex-wrap: wrap; }
.toggle { white-space: nowrap; }
.author-tools { display: flex; gap: 1.1rem; align-items: baseline; color: var(--rain); flex-basis: 100%; order: 10; padding-top: .45rem; margin-top: .1rem; border-top: 1px dashed var(--wet); }
.author-tools label { display: flex; gap: .35rem; align-items: baseline; cursor: pointer; }
.author-tools select { background: var(--dusk-deep); border: 1px solid var(--wet); border-radius: 3px; padding: 0 .3rem; font-size: .8rem; }
.author-tools input { accent-color: var(--lamp); }
.cost { font-variant-numeric: tabular-nums; }
.music-test { display: flex; gap: .4rem; align-items: center; }
.music-test input[type=range] { width: 7rem; }
.writing { color: var(--rain); font-style: italic; max-width: var(--measure); }
.writing::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.4s steps(4, end) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
@media (prefers-reduced-motion: reduce) { .writing::after { animation: none; content: "..."; } }
.toggle { color: var(--rain); cursor: pointer; display: flex; gap: .35rem; align-items: center; }
.sound { display: inline-flex; gap: .45rem; align-items: center; margin-right: .9rem; }
.sound input[type=range] { width: 64px; accent-color: var(--lamp); }
.sound button[aria-pressed="false"] { text-decoration: line-through; }
.toggle input { accent-color: var(--lamp); }

/* ---------- reading ---------- */
.play { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.transcript { flex: 1; overflow-y: auto; padding: 2rem 1.6rem 1rem; scroll-behavior: smooth; }
.turn { max-width: var(--measure); margin: 0 0 1.6rem; }
@media (min-width: 901px) { .column { font-size: 18px; } }
.turn p { margin: 0 0 .9em; }
.turn .you { color: var(--lamp); font-style: italic; margin: 0 0 .7em; }
.turn.past { opacity: .62; transition: opacity .3s; }
.turn.past:hover { opacity: 1; }
.turn.ending .prose::after { content: ""; display: block; width: 3.5em; margin: 1.6em 0 0; border-top: 1px solid var(--rain); }

/* ---------- acting ---------- */
.act { border-top: 1px solid var(--wet); padding: 1rem 1.6rem 1.3rem; }
.choices { display: flex; flex-direction: column; gap: .15rem; margin-bottom: .7rem; }
.choice {
  display: flex; align-items: center; gap: .7em;
  text-align: left; background: none; border: 0; padding: .25rem 0; cursor: pointer;
  color: var(--paper); font-size: .98rem;
}
.choice:hover, .choice:focus-visible { color: var(--lamp); }
.choice::before { content: ""; flex: none; width: .42em; height: .42em; border-radius: 50%; background: var(--wet); transition: background .3s; }
.choice:hover::before, .choice:focus-visible::before { background: var(--lamp); box-shadow: 0 0 8px var(--lamp); }
.say { display: flex; gap: .6rem; align-items: flex-end; }
.say textarea {
  flex: 1; resize: none; background: var(--dusk-deep); border: 1px solid var(--wet); border-radius: 3px;
  padding: .55rem .7rem; font-size: .95rem; line-height: 1.45; color: var(--paper);
}
.say textarea::placeholder { color: var(--rain); font-style: italic; }
.send { background: none; border: 1px solid var(--lamp); color: var(--lamp); border-radius: 3px; padding: .45rem 1rem; cursor: pointer; }
.send:hover { background: var(--lamp); color: var(--dusk); }
.send[disabled] { opacity: .4; cursor: wait; }
.error { color: var(--danger); font-size: .88rem; margin: .5rem 0 0; }
.ended { color: var(--rain); font-style: italic; font-size: .92rem; }

.choice.go::before { background: none; border: 1px solid var(--rain); width: .5em; height: .5em; }
.choice.go:hover::before, .choice.go:focus-visible::before { border-color: var(--lamp); background: none; box-shadow: none; }
.choice.go { color: var(--rain); }
.choice.go:hover { color: var(--lamp); }
.choices .gap { height: .5rem; }
.choice.linger { font-style: italic; color: var(--rain); }
.choice.linger:hover, .choice.linger:focus-visible { color: var(--lamp); }
.choice.linger::before { background: none; border: 1px dotted var(--rain); }
.replay { background: none; border: 0; padding: 0; margin: -.3rem 0 .8rem; color: var(--rain); font-size: .8rem; font-style: italic; cursor: pointer; }
.replay:hover { color: var(--lamp); }
body.authoring .choice.improvised::after { content: "improvised"; font-size: .7rem; font-style: italic; color: var(--rain); margin-left: .2em; }
.looks { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem; margin: .1rem 0 .7rem; font-size: .92rem; }
.looks:empty { display: none; }
.looks .lbl { color: var(--rain); font-style: italic; }
.looks button { background: none; border: 0; border-bottom: 1px dotted var(--wet); padding: 0 0 .05rem; color: var(--paper); cursor: pointer; text-align: left; }
.looks button:hover { color: var(--lamp); border-bottom-color: var(--lamp); }
.looks button.seen { color: var(--rain); border-bottom-color: transparent; }
.verbs { display: flex; gap: 1.4rem; margin: .4rem 0 .2rem; font-size: .85rem; }
.verbs button { background: none; border: 0; padding: 0; color: var(--rain); cursor: pointer; }
.verbs button:hover, .verbs button[aria-expanded="true"] { color: var(--lamp); }
.verb-panel { margin: .5rem 0 .2rem; padding: .5rem 0 .2rem 1rem; border-left: 1px solid var(--wet); font-size: .9rem; }
.verb-panel button { display: block; background: none; border: 0; padding: .18rem 0; color: var(--paper); cursor: pointer; text-align: left; }
.verb-panel button:hover { color: var(--lamp); }
.verb-panel button.seen { color: var(--rain); }
.verb-panel .note { margin: .15rem 0 .35rem; color: var(--paper); font-style: italic; }
.verb-panel .sub { color: var(--rain); font-size: .8rem; margin: .4rem 0 .15rem; }
.author-only { display: none !important; }
body.authoring .author-only:not([hidden]) { display: flex !important; }
.say { margin-top: .8rem; }

/* ---------- home ---------- */
.home { overflow-y: auto; padding: 2.6rem 1.6rem 2rem; }
.home h1 { font-weight: 300; font-size: 3.2rem; line-height: 1; margin: 0 0 .5rem; letter-spacing: .02em; }
.home .lede { color: var(--rain); font-style: italic; margin: 0 0 2.2rem; max-width: var(--measure); }
.home h2 { font-weight: 600; font-size: .95rem; margin: 2rem 0 .6rem; color: var(--paper); }
.home ul { list-style: none; margin: 0; padding: 0; }
.home li { padding: .45rem 0; border-bottom: 1px solid var(--wet); display: flex; gap: .8rem; align-items: baseline; }
.home li .meta { color: var(--rain); font-size: .85rem; margin-left: auto; white-space: nowrap; }
.home li.picked { color: var(--lamp); }
.link { background: none; border: 0; padding: 0; cursor: pointer; color: var(--paper); text-align: left; }
.link:hover { color: var(--lamp); }
.home .empty { color: var(--rain); font-style: italic; font-size: .92rem; }
.new-prot { display: grid; grid-template-columns: 1fr 8.5em; gap: .5rem; margin-top: .7rem; }
.new-prot input, .new-prot select, .new-prot textarea {
  background: var(--dusk-deep); border: 1px solid var(--wet); border-radius: 3px; padding: .4rem .6rem; font-size: .92rem;
}
.new-prot textarea { grid-column: 1 / -1; resize: vertical; min-height: 3.2em; }
.new-prot button { grid-column: 1 / -1; justify-self: start; }
.begin { margin-top: 1.6rem; }

/* ---------- author mode ---------- */
.tools { display: none; gap: 1rem; font-size: .78rem; margin: -.4rem 0 .6rem; flex-wrap: wrap; }
body.authoring .tools { display: flex; }
.tools .quiet:hover { color: var(--lamp); }
.edge { display: none; margin: 0 0 .5rem; font-size: .82rem; color: var(--rain); }
body.authoring .edge { display: flex; gap: .5rem; align-items: center; }
.edge input { flex: 1; background: var(--dusk-deep); border: 1px solid var(--wet); border-radius: 3px; padding: .2rem .5rem; font-size: .85rem; font-style: italic; color: var(--lamp); }
.edit-area { width: 100%; min-height: 14em; background: var(--dusk-deep); border: 1px solid var(--lamp); border-radius: 3px; padding: .7rem; line-height: 1.55; font-size: .95rem; }
.edited-mark { color: var(--rain); font-size: .75rem; font-style: italic; }
.debug { display: none; color: var(--rain); font-size: .75rem; white-space: pre-wrap; margin: 0 0 .6rem; }
body.authoring .debug:not(:empty) { display: block; }

/* ---------- branches drawer ---------- */
.tree { position: absolute; inset: 0; background: var(--dusk); overflow-y: auto; padding: 1.2rem 1.6rem 2rem; z-index: 5; }
.tree-head { display: flex; align-items: baseline; justify-content: space-between; }
.tree h2 { font-weight: 600; font-size: 1rem; margin: 0; }
.tree .hint { color: var(--rain); font-size: .85rem; font-style: italic; }
.tree ul { list-style: none; margin: 0; padding-left: 1.1rem; border-left: 1px solid var(--wet); }
.tree > div > ul { padding-left: 0; border-left: 0; }
.tree li { margin: .35rem 0; }
.tree .node { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; color: var(--rain); font-size: .88rem; }
.tree .node.on { color: var(--paper); }
.tree .node.cur { color: var(--lamp); }
.tree .node.pruned { text-decoration: line-through; opacity: .5; }
.tree .node:hover { color: var(--lamp); }

/* ---------- stories drawer ---------- */
.drawer h3 { font-weight: 600; font-size: .98rem; margin: 1.8rem 0 .2rem; }
.drawer .file { color: var(--rain); font-size: .78rem; font-weight: 400; margin-left: .4rem; }
.drawer .path { font-family: ui-monospace, Consolas, monospace; font-size: .78rem; color: var(--paper); word-break: break-all; }
.drawer .status { font-size: .85rem; margin: 0 0 .5rem; }
.drawer .status.ok { color: var(--rain); }
.drawer .status.bad { color: var(--danger); }
.drawer ul.msgs { list-style: none; padding: 0; border: 0; margin: .3rem 0 .7rem; font-size: .82rem; }
.drawer ul.msgs li { margin: .25rem 0; padding-left: .9rem; text-indent: -.9rem; }
.drawer ul.msgs.problems li { color: var(--danger); }
.drawer ul.msgs.warnings li { color: var(--rain); }
.drawer ul.msgs li::before { content: "– "; }
.drawer .art { list-style: none; padding: 0; border: 0; margin: .3rem 0 0; }
.drawer .art > li { margin: 0; padding: .45rem 0; border-bottom: 1px solid var(--wet); font-size: .85rem; }
.drawer .art .row { display: flex; gap: .7rem; align-items: baseline; }
.drawer .art .name { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; }
.drawer .art .what { color: var(--rain); font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.drawer .art .state { margin-left: auto; white-space: nowrap; font-size: .78rem; color: var(--rain); }
.drawer .art .state.need { color: var(--lamp); }
.drawer details { margin: .3rem 0 0; }
.drawer summary { cursor: pointer; color: var(--rain); font-size: .78rem; }
.drawer summary:hover { color: var(--lamp); }
.drawer .prompt { font-size: .8rem; line-height: 1.45; color: var(--paper); background: var(--dusk-deep); border: 1px solid var(--wet); border-radius: 3px; padding: .5rem .6rem; margin: .4rem 0; white-space: pre-wrap; }
.drawer .refs { color: var(--rain); font-size: .78rem; margin: .2rem 0; }
.drawer .actions-row { display: flex; gap: 1rem; align-items: baseline; margin: .6rem 0 0; }

/* ---------- fullscreen painting ---------- */
.full { padding: 0; border: 0; background: #0e1116; max-width: 100vw; max-height: 100vh; }
.full::backdrop { background: rgba(10, 12, 16, .92); }
.full img { display: block; max-width: 96vw; max-height: 92vh; }
.full form { position: absolute; top: .6rem; right: .9rem; }

/* ---------- phones: painting on top, text below ---------- */
@media (max-width: 900px) {
  .frame { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; height: auto; min-height: 100vh; }
  .painting { position: sticky; top: 0; z-index: 2; height: auto; }
  .painting .layer { height: auto; aspect-ratio: 3 / 2; max-height: 45vh; }
  .toggle { white-space: nowrap; }
  .bar { gap: .7rem; }
  .column { border-left: 0; }
  .transcript { overflow: visible; }
  body { font-size: 18px; }
  .bar, .transcript, .act, .home { padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .painting .layer { transition: none; filter: none; }
  .transcript { scroll-behavior: auto; }
}


/* ---------- wandering a district: full screen ---------- */
.w-name, .w-edge, .w-dock, .w-panel, .w-author { display: none; }
body.wander { background: #0b0e12; overflow: hidden; }
body.wander .frame { display: block; height: 100vh; height: 100dvh; }
body.wander .column { display: none; }
body.wander .painting { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; background: #0b0e12; }
/* The painting always fills the screen, never with bands: when the window isn't 16:9 it is scaled just
   enough to fill it, trimming a little off the top and bottom (or the sides), centred. */
body.wander .painting .layer { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; aspect-ratio: auto; object-fit: cover; }
body.wander .w-name, body.wander .w-dock, body.wander .w-edge { display: flex; }
body.wander .w-panel:not([hidden]), body.wander.authoring .w-author:not([hidden]) { display: flex; }

.w-name { position: absolute; z-index: 4; left: clamp(16px, 3vw, 44px); top: clamp(14px, 3vh, 38px); flex-direction: column; gap: .15rem;
  pointer-events: none; text-shadow: 0 1px 12px rgba(0,0,0,.65), 0 0 2px rgba(0,0,0,.4); opacity: 0; transition: opacity 2.2s ease; }
.w-name.in { opacity: .92; }
.w-name.rest { opacity: .55; transition: opacity 4s ease; }
.w-place { font: 400 clamp(1.05rem, 1.6vw, 1.5rem)/1.2 "Spectral", Georgia, serif; letter-spacing: .14em; text-transform: uppercase; color: #efe4cc; }
.w-set { font: italic 300 clamp(.8rem, 1vw, .95rem)/1.3 "Spectral", Georgia, serif; color: #c9bfae; letter-spacing: .04em; }

.w-dock { position: absolute; z-index: 5; right: clamp(12px, 2.2vw, 30px); bottom: clamp(12px, 2.4vh, 28px); gap: .35rem;
  padding: .3rem; border-radius: 999px; background: rgba(12,15,20,.38); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: opacity .8s ease; }
.w-dock button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; color: #e9dfca; cursor: pointer;
  display: grid; place-items: center; opacity: .82; transition: opacity .2s, background .2s; }
.w-dock button:hover, .w-dock button[aria-expanded="true"] { opacity: 1; background: rgba(255,255,255,.08); }
/* The map: the way to go anywhere else, so it is the one thing in the dock that catches the eye. */
.w-dock #w-places-btn { width: auto; padding: 0 .8rem 0 .62rem; gap: .38rem; display: flex; align-items: center; border-radius: 999px;
  color: #e2b65e; opacity: 1; background: rgba(226,182,94,.1); box-shadow: inset 0 0 0 1px rgba(226,182,94,.38); }
.w-dock #w-places-btn:hover { background: rgba(226,182,94,.2); box-shadow: inset 0 0 0 1px rgba(226,182,94,.6); }
.w-dock #w-places-btn span { font: 400 .72rem/1 "Spectral", Georgia, serif; letter-spacing: .14em; text-transform: uppercase; }
.w-dock svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.w-dock .w-off { display: none; }
.w-dock .muted .w-on { display: none; } .w-dock .muted .w-off { display: inline; }
.w-edge { position: absolute; z-index: 4; top: 50%; transform: translateY(-50%); width: 56px; height: 120px; border: 0; background: transparent;
  color: #efe4cc; font: 300 3rem/1 "Spectral", serif; cursor: pointer; opacity: 0; transition: opacity .6s ease; align-items: center; justify-content: center;
  text-shadow: 0 1px 10px rgba(0,0,0,.7); }
.w-prev { left: 0; } .w-next { right: 0; }
body.wander:not(.w-idle) .w-edge { opacity: .45; }
.w-edge:hover { opacity: .9 !important; }
/* When the mouse rests, the dock fades away, all but the map: the way to go elsewhere is always there. */
.w-dock { transition: opacity .8s ease, background .8s ease, box-shadow .8s ease; }
.w-dock button { transition: opacity .8s ease, background .2s; }
body.wander.w-idle .w-dock { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; pointer-events: none; }
body.wander.w-idle .w-dock button:not(#w-places-btn) { opacity: 0; }
body.wander.w-idle .w-dock #w-places-btn { opacity: .78; pointer-events: auto; background: rgba(12,15,20,.42); }
body.wander.w-idle { cursor: none; }

.w-panel { position: absolute; z-index: 6; right: clamp(12px, 2.2vw, 30px); bottom: calc(clamp(12px, 2.4vh, 28px) + 56px);
  flex-direction: column; gap: .1rem; min-width: 220px; max-width: min(420px, calc(100vw - 32px)); max-height: 60vh; overflow: auto;
  padding: .7rem .5rem; border-radius: 10px; background: rgba(12,15,20,.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: #e9dfca; font: 300 1rem/1.4 "Spectral", Georgia, serif; }
.w-panel h3 { font: 600 .72rem/1 "Spectral", serif; letter-spacing: .16em; text-transform: uppercase; color: #c9bfae; margin: .3rem .6rem .5rem; }
.w-panel button.w-item { text-align: left; border: 0; background: transparent; color: inherit; font: inherit; padding: .35rem .6rem; border-radius: 6px; cursor: pointer; }
.w-panel button.w-item:hover { background: rgba(255,255,255,.07); }
.w-panel button.w-item.on { color: var(--lamp); }
.w-panel .w-row { display: flex; align-items: center; gap: .6rem; padding: .35rem .6rem; }
.w-panel input[type=range] { flex: 1; accent-color: var(--lamp); }
.w-panel .w-hint { font-size: .8rem; color: #a99f8f; padding: .2rem .6rem; }

.w-author { position: absolute; z-index: 9; bottom: clamp(12px, 2.4vh, 28px); left: 50%; transform: translateX(-50%); gap: .5rem; align-items: center; flex-wrap: wrap; justify-content: flex-end;
  max-width: min(760px, 70vw); padding: .4rem .6rem; border-radius: 8px; background: rgba(12,15,20,.75); color: #e9dfca; font: 300 .85rem/1.3 "Spectral", serif; }
.w-author button { border: 1px solid rgba(255,255,255,.18); background: transparent; color: inherit; font: inherit; padding: .2rem .6rem; border-radius: 4px; cursor: pointer; }
.w-author button.on { border-color: var(--lamp); color: var(--lamp); }
.w-todo, .w-help { color: #a99f8f; }

@media (max-width: 700px), (pointer: coarse) {
  .w-dock button { width: 44px; height: 44px; }
  .w-edge { width: 44px; }
  body.wander:not(.w-idle) .w-edge { opacity: .55; }
}

/* the title screen */
body.wander .w-title:not([hidden]) { display: grid; }
.w-title { display: none; position: absolute; inset: 0; z-index: 7; place-items: center; text-align: center; color: #efe4cc;
  background: radial-gradient(ellipse at center, rgba(4,5,8,.55) 0%, rgba(4,5,8,.78) 58%, rgba(2,3,4,.96) 100%);
  transition: opacity 1.4s ease; }
.w-title.out { opacity: 0; pointer-events: none; }
.w-title-inner { max-width: min(640px, 86vw); padding: 0 16px; animation: w-rise 2.4s ease both .4s; }
@keyframes w-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* The world's name first and largest; the year small and wide like a date on a map; then the district. */
.w-title h1.w-world { font: 300 clamp(3rem, 8vw, 6.2rem)/1 "Spectral", Georgia, serif; letter-spacing: .32em; text-transform: uppercase;
  margin: 0 0 .7rem; padding-left: .32em; text-shadow: 0 2px 34px rgba(0,0,0,.65); }
.w-year { font: 400 clamp(.8rem, 1vw, .95rem)/1 "Spectral", serif; letter-spacing: .6em; padding-left: .6em; color: #c9b48f; margin: 0 0 1.6rem; }
.w-year:empty { display: none; }
.w-district { font: italic 300 clamp(1.15rem, 1.9vw, 1.5rem)/1.3 "Spectral", serif; color: #efe4cc; margin: 0 0 1.3rem; letter-spacing: .02em; }
.w-district::before, .w-district::after { content: ""; display: inline-block; width: 2.2em; height: 1px; background: rgba(239,228,204,.35); vertical-align: middle; margin: 0 .8em; }
.w-next { font: italic 300 .9rem/1.4 "Spectral", serif; color: #8f8778; margin: 1.6rem 0 0; letter-spacing: .03em; }
.w-next:empty { display: none; }
.w-ways button.primary { background: rgba(226,169,91,.2); border-color: rgba(226,169,91,.75); }
.w-invite { font: italic 300 clamp(1rem, 1.5vw, 1.2rem)/1.6 "Spectral", serif; color: #d9cdb6; margin: 0 auto 2.2rem; max-width: 34em; text-wrap: pretty; }
.w-ways { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.w-ways button { font: 400 1rem/1 "Spectral", serif; letter-spacing: .06em; color: #f3e8d0; padding: .85rem 1.5rem; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(239,228,204,.45); background: rgba(10,12,16,.35); backdrop-filter: blur(4px); transition: background .3s, border-color .3s; }
.w-ways button:hover { background: rgba(226,169,91,.18); border-color: rgba(226,169,91,.8); }
.w-phones { font: italic 300 .85rem/1 "Spectral", serif; color: #9d9384; margin-top: 1rem; }
.w-corner { position: absolute; left: 18px; bottom: 16px; border: 0; background: transparent; color: rgba(239,228,204,.35); font-size: 14px; cursor: pointer; }
.w-corner:hover { color: rgba(239,228,204,.8); }
body.w-titled .w-name, body.w-titled .w-dock, body.w-titled .w-edge { opacity: 0 !important; pointer-events: none; }

/* the map */
body.wander .w-map:not([hidden]) { display: grid; }
.w-map { display: none; position: absolute; inset: 0; z-index: 8; place-items: center; background: rgba(4,6,9,.72); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: w-fade .5s ease both; }
@keyframes w-fade { from { opacity: 0; } to { opacity: 1; } }
.w-map-box { position: relative; display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.w-map-frame { position: relative; width: min(92vw, calc(84vh * 16 / 9)); aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden;
  box-shadow: 0 20px 80px rgba(0,0,0,.6); background: #0a0f1a; }
.w-map-frame img { width: 100%; height: 100%; object-fit: contain; display: block; }
.w-map-frame.empty img { display: none; }
.w-pins { position: absolute; inset: 0; }
.w-pin { position: absolute; transform: translate(-50%, -50%); border: 0; background: transparent; cursor: pointer; padding: 6px; }
.w-pin > i { display: block; width: 11px; height: 11px; border-radius: 50%; background: #f0c27a; box-shadow: 0 0 0 2px rgba(10,15,26,.85), 0 0 14px 4px rgba(240,194,122,.55); transition: transform .2s; }
.w-pin.here > i { background: #fff3da; box-shadow: 0 0 0 2px rgba(10,15,26,.85), 0 0 22px 8px rgba(255,220,160,.8); }
.w-pin > span { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); white-space: nowrap; font: 400 .85rem/1 "Spectral", serif; letter-spacing: .04em;
  color: #f3e8d0; background: rgba(10,15,26,.88); padding: .35rem .55rem; border-radius: 4px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.w-pin:hover > i { transform: scale(1.35); } .w-pin:hover > span, .w-pin.here > span { opacity: 1; }
.w-map-tabs { display: flex; gap: .4rem; }
.w-map-tabs button, .w-map-list button { border: 1px solid rgba(239,228,204,.25); background: rgba(10,12,16,.5); color: #e9dfca; font: 400 .9rem/1 "Spectral", serif;
  padding: .45rem .8rem; border-radius: 999px; cursor: pointer; }
.w-map-tabs button.on, .w-map-list button.on { border-color: var(--lamp); color: var(--lamp); }
.w-map-list { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; max-width: min(92vw, 1100px); max-height: 18vh; overflow: auto; }
.w-map-list:empty { display: none; }
.w-map-close { position: absolute; top: 2.4rem; right: -2.6rem; border: 0; background: transparent; color: #e9dfca; font-size: 2rem; cursor: pointer; }
@media (max-width: 900px) { .w-map-close { right: .4rem; top: 2.6rem; z-index: 2; } }

/* something to touch: the hint that follows the cursor */
.w-hint-tag { position: absolute; z-index: 6; pointer-events: none; font: italic 400 .9rem/1 "Spectral", serif; color: #f3e8d0;
  background: rgba(10,12,16,.7); padding: .35rem .6rem; border-radius: 999px; transform: translate(14px, -130%); }
body.wander .w-hint-tag:not([hidden]) { display: block; }
.w-hint-tag { display: none; }
/* Leaving something: two quiet choices by the hand. */
.w-offer { position: absolute; z-index: 7; transform: translate(14px, -50%); display: flex; flex-direction: column; gap: .15rem;
  padding: .35rem; border-radius: 8px; background: rgba(10,12,18,.82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.w-offer button { border: 0; background: transparent; color: #efe4cc; font: italic 400 .92rem/1.2 "Spectral", Georgia, serif;
  text-align: left; padding: .38rem .7rem; border-radius: 5px; cursor: pointer; white-space: nowrap; }
.w-offer button:hover { background: rgba(255,255,255,.08); color: #fff3da; }
/* The standing word by an empty offering spot: quiet, above where things are left. */
.w-offer-tag { position: absolute; z-index: 5; pointer-events: none; transform: translate(-50%, calc(-100% - 22px));
  font: italic 400 .85rem/1 "Spectral", Georgia, serif; color: #efe4cc; background: rgba(10,12,16,.55); padding: .3rem .6rem;
  border-radius: 999px; white-space: nowrap; opacity: 0; transition: opacity 1.2s ease; }
.w-offer-tag.on { opacity: .85; }
body:not(.wander) .w-offer-tag, body.w-titled .w-offer-tag, body.w-reading .w-offer-tag, body.w-mapopen .w-offer-tag { opacity: 0 !important; }
/* A line by the hand that stays a little and goes. */
.w-note { position: absolute; z-index: 6; pointer-events: none; transform: translate(-30%, 30px); max-width: 22rem;
  font: italic 400 .95rem/1.35 "Spectral", Georgia, serif; color: #f3e8d0; text-shadow: 0 1px 8px rgba(0,0,0,.85), 0 0 2px rgba(0,0,0,.9);
  opacity: 0; transition: opacity 1.1s ease; }
.w-note.on { opacity: 1; }
body.w-touchable .painting { cursor: pointer; }

/* While painting mist in the wander view, its tool bar sits at the top, clear of the author bar. */
body.wander .mark-bar { top: 1rem; bottom: auto; left: 50%; right: auto; transform: translateX(-50%); z-index: 9; max-width: min(900px, 92vw); }

/* Things to touch: the cursor says what you can do, drawn in fine lines in the cream of the titles.
   A hand for an animal or a bell (tilting into a stroke), a flame for something to light, an ear at
   a window, sound going out at an empty doorway. Touch drags never scroll the page here. */
body.wander[data-touch=stroke] .painting, body.wander[data-touch=stroke] .painting *,
body.wander[data-touch=offer] .painting, body.wander[data-touch=offer] .painting *,
body.wander[data-touch=reach] .painting, body.wander[data-touch=reach] .painting *,
body.wander[data-touch=take] .painting, body.wander[data-touch=take] .painting *,
body.wander[data-touch=ring] .painting, body.wander[data-touch=ring] .painting * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 48 48'%3E%3Cg transform='rotate%28-10 24 24%29' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg stroke='%23140f0a' stroke-width='3.6' opacity='.45'%3E%3Cpath d='M17 44 C16.4 40 14.6 37.2 12.2 33.6 L7.8 27 C6.8 25.3 8.8 23.6 10.4 25 L14.6 28.8 L14.3 12.4 C14.3 10.1 17.7 10.1 17.7 12.4 L17.9 22.4'/%3E%3Cpath d='M17.9 22.4 L18.3 8.8 C18.3 6.5 21.9 6.5 21.9 8.8 L21.9 22.2'/%3E%3Cpath d='M21.9 22.2 L22.7 10.8 C22.9 8.6 26.3 8.8 26.1 11.1 L25.5 23.2'/%3E%3Cpath d='M25.5 23.2 L27.7 15.4 C28.3 13.3 31.5 14.2 30.9 16.4 L28.3 28.8 C27.4 33.2 26.6 36.4 26.2 40.4 L26 44'/%3E%3C/g%3E%3Cg stroke='%23f3e8d0' stroke-width='1.35'%3E%3Cpath d='M17 44 C16.4 40 14.6 37.2 12.2 33.6 L7.8 27 C6.8 25.3 8.8 23.6 10.4 25 L14.6 28.8 L14.3 12.4 C14.3 10.1 17.7 10.1 17.7 12.4 L17.9 22.4'/%3E%3Cpath d='M17.9 22.4 L18.3 8.8 C18.3 6.5 21.9 6.5 21.9 8.8 L21.9 22.2'/%3E%3Cpath d='M21.9 22.2 L22.7 10.8 C22.9 8.6 26.3 8.8 26.1 11.1 L25.5 23.2'/%3E%3Cpath d='M25.5 23.2 L27.7 15.4 C28.3 13.3 31.5 14.2 30.9 16.4 L28.3 28.8 C27.4 33.2 26.6 36.4 26.2 40.4 L26 44'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") 20 20, grab; }
body.wander.w-petting, body.wander.w-petting .painting, body.wander.w-petting .painting * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 48 48'%3E%3Cg transform='rotate%2814 24 24%29' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg stroke='%23140f0a' stroke-width='3.6' opacity='.45'%3E%3Cpath d='M17 44 C16.4 40 14.6 37.2 12.2 33.6 L7.8 27 C6.8 25.3 8.8 23.6 10.4 25 L14.6 28.8 L14.3 12.4 C14.3 10.1 17.7 10.1 17.7 12.4 L17.9 22.4'/%3E%3Cpath d='M17.9 22.4 L18.3 8.8 C18.3 6.5 21.9 6.5 21.9 8.8 L21.9 22.2'/%3E%3Cpath d='M21.9 22.2 L22.7 10.8 C22.9 8.6 26.3 8.8 26.1 11.1 L25.5 23.2'/%3E%3Cpath d='M25.5 23.2 L27.7 15.4 C28.3 13.3 31.5 14.2 30.9 16.4 L28.3 28.8 C27.4 33.2 26.6 36.4 26.2 40.4 L26 44'/%3E%3C/g%3E%3Cg stroke='%23f3e8d0' stroke-width='1.35'%3E%3Cpath d='M17 44 C16.4 40 14.6 37.2 12.2 33.6 L7.8 27 C6.8 25.3 8.8 23.6 10.4 25 L14.6 28.8 L14.3 12.4 C14.3 10.1 17.7 10.1 17.7 12.4 L17.9 22.4'/%3E%3Cpath d='M17.9 22.4 L18.3 8.8 C18.3 6.5 21.9 6.5 21.9 8.8 L21.9 22.2'/%3E%3Cpath d='M21.9 22.2 L22.7 10.8 C22.9 8.6 26.3 8.8 26.1 11.1 L25.5 23.2'/%3E%3Cpath d='M25.5 23.2 L27.7 15.4 C28.3 13.3 31.5 14.2 30.9 16.4 L28.3 28.8 C27.4 33.2 26.6 36.4 26.2 40.4 L26 44'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") 20 20, grabbing; }
body.wander[data-touch=light] .painting, body.wander[data-touch=light] .painting * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 48 48'%3E%3Cg transform='rotate%280 24 24%29' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg stroke='%23140f0a' stroke-width='3.6' opacity='.45'%3E%3Cpath d='M24 7 C25.6 13 31.5 16.4 31.5 25 C31.5 31.4 28 35.5 24 35.5 C20 35.5 16.5 31.4 16.5 25.6 C16.5 20.6 19.8 18.4 21.4 14.6 C22.3 17.4 23 18.6 24.2 19.2 C23.4 15.6 23 11.6 24 7 Z'/%3E%3Cpath d='M24 24 C25.5 26.4 27 27.8 27 30 C27 31.8 25.7 33 24 33 C22.3 33 21 31.8 21 30 C21 27.8 22.6 26.2 24 24 Z'/%3E%3C/g%3E%3Cg stroke='%23f3e8d0' stroke-width='1.35'%3E%3Cpath d='M24 7 C25.6 13 31.5 16.4 31.5 25 C31.5 31.4 28 35.5 24 35.5 C20 35.5 16.5 31.4 16.5 25.6 C16.5 20.6 19.8 18.4 21.4 14.6 C22.3 17.4 23 18.6 24.2 19.2 C23.4 15.6 23 11.6 24 7 Z'/%3E%3Cpath d='M24 24 C25.5 26.4 27 27.8 27 30 C27 31.8 25.7 33 24 33 C22.3 33 21 31.8 21 30 C21 27.8 22.6 26.2 24 24 Z'/%3E%3C/g%3E%3Cpath d='M24 24 C25.5 26.4 27 27.8 27 30 C27 31.8 25.7 33 24 33 C22.3 33 21 31.8 21 30 C21 27.8 22.6 26.2 24 24 Z' fill='%23ffd9a0' opacity='.55' stroke='none'/%3E%3C/g%3E%3C/svg%3E") 20 22, pointer; }
body.wander[data-touch=listen] .painting, body.wander[data-touch=listen] .painting * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 48 48'%3E%3Cg transform='rotate%280 24 24%29' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg stroke='%23140f0a' stroke-width='3.6' opacity='.45'%3E%3Cpath d='M16 18.5 C16 11.5 20.5 7.5 25.5 7.5 C31 7.5 34.5 11.5 34.5 17 C34.5 21.5 32 23.2 30.4 25.2 C28.8 27.2 29.2 30.2 27.6 32.8 C26.1 35.2 23.4 36 21.2 35'/%3E%3Cpath d='M21 18 C21 14.4 23 12.6 25.6 12.6 C28.2 12.6 29.7 14.6 29.7 17 C29.7 19.2 27.8 20.2 26.8 21.8 C26.1 23 26.6 24.4 25.3 25.4'/%3E%3Cpath d='M10.5 15 C8.6 18 8.6 22.2 10.5 25.2'/%3E%3Cpath d='M6 12.2 C3 16.6 3 23.6 6 28'/%3E%3C/g%3E%3Cg stroke='%23f3e8d0' stroke-width='1.35'%3E%3Cpath d='M16 18.5 C16 11.5 20.5 7.5 25.5 7.5 C31 7.5 34.5 11.5 34.5 17 C34.5 21.5 32 23.2 30.4 25.2 C28.8 27.2 29.2 30.2 27.6 32.8 C26.1 35.2 23.4 36 21.2 35'/%3E%3Cpath d='M21 18 C21 14.4 23 12.6 25.6 12.6 C28.2 12.6 29.7 14.6 29.7 17 C29.7 19.2 27.8 20.2 26.8 21.8 C26.1 23 26.6 24.4 25.3 25.4'/%3E%3Cpath d='M10.5 15 C8.6 18 8.6 22.2 10.5 25.2'/%3E%3Cpath d='M6 12.2 C3 16.6 3 23.6 6 28'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") 20 20, help; }
body.wander[data-touch=call] .painting, body.wander[data-touch=call] .painting * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 48 48'%3E%3Cg transform='rotate%280 24 24%29' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg stroke='%23140f0a' stroke-width='3.6' opacity='.45'%3E%3Cpath d='M13 24 m-2.4 0 a2.4 2.4 0 1 0 4.8 0 a2.4 2.4 0 1 0 -4.8 0'/%3E%3Cpath d='M19.5 17 C22 20.5 22 27.5 19.5 31'/%3E%3Cpath d='M25 13 C29 18.6 29 29.4 25 35'/%3E%3Cpath d='M30.5 9 C36 16.6 36 31.4 30.5 39'/%3E%3C/g%3E%3Cg stroke='%23f3e8d0' stroke-width='1.35'%3E%3Cpath d='M13 24 m-2.4 0 a2.4 2.4 0 1 0 4.8 0 a2.4 2.4 0 1 0 -4.8 0'/%3E%3Cpath d='M19.5 17 C22 20.5 22 27.5 19.5 31'/%3E%3Cpath d='M25 13 C29 18.6 29 29.4 25 35'/%3E%3Cpath d='M30.5 9 C36 16.6 36 31.4 30.5 39'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") 11 20, pointer; }
body.wander[data-touch=coin] .painting, body.wander[data-touch=coin] .painting * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 48 48'%3E%3Cg transform='rotate%28-14 24 24%29' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg stroke='%23140f0a' stroke-width='3.6' opacity='.45'%3E%3Cpath d='M24 24 m-13 0 a13 10.5 0 1 0 26 0 a13 10.5 0 1 0 -26 0'/%3E%3Cpath d='M24 24 m-9.2 0 a9.2 7.3 0 1 0 18.4 0 a9.2 7.3 0 1 0 -18.4 0'/%3E%3Cpath d='M17.8 20.6 C19.4 18.6 21.6 17.7 24 17.6'/%3E%3C/g%3E%3Cg stroke='%23f3e8d0' stroke-width='1.35'%3E%3Cpath d='M24 24 m-13 0 a13 10.5 0 1 0 26 0 a13 10.5 0 1 0 -26 0'/%3E%3Cpath d='M24 24 m-9.2 0 a9.2 7.3 0 1 0 18.4 0 a9.2 7.3 0 1 0 -18.4 0'/%3E%3Cpath d='M17.8 20.6 C19.4 18.6 21.6 17.7 24 17.6'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") 20 20, pointer; }
body.wander .painting { touch-action: none; }
.w-kind { margin: 0 .2rem; padding: .15rem .55rem; border-radius: 999px; border: 1px solid rgba(243,232,208,.3); background: rgba(20,22,30,.6); color: #f3e8d0; font: inherit; cursor: pointer; }
.w-kind:hover { background: rgba(243,232,208,.15); }

/* A story belonging to a place: a tab that slides in from the right edge, dark and partly see-through,
   so it is plainly there without covering the painting. The city keeps its name in the corner. */
.w-story { display: none; }
body.wander .w-story:not([hidden]) { display: flex; }
.w-story { position: absolute; z-index: 5; right: 0; top: clamp(18px, 4.2vh, 46px); align-items: center; gap: .9rem;
  max-width: min(400px, 78vw); padding: .85rem 1.15rem .9rem 1rem; text-align: left; cursor: pointer; color: #efe4cc;
  background: linear-gradient(to left, rgba(9,10,15,.82), rgba(9,10,15,.64)); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(239,228,204,.16); border-right: 0; border-radius: 12px 0 0 12px; box-shadow: -10px 12px 34px rgba(0,0,0,.35);
  transform: translateX(105%); opacity: 0; transition: transform 1.3s cubic-bezier(.2,.7,.2,1), opacity 1.1s ease, background .3s ease; }
.w-story.in { transform: translateX(0); opacity: 1; }
.w-story:hover, .w-story:focus-visible { background: linear-gradient(to left, rgba(9,10,15,.9), rgba(9,10,15,.76)); outline: none; }
.w-story.in:hover { transform: translateX(-4px); transition: transform .35s ease, background .3s ease; }
.w-story-mark { flex: none; width: 34px; height: 34px; fill: none; stroke: #e7d6b3; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.w-story-text { display: flex; flex-direction: column; gap: .12rem; min-width: 0; }
.w-story-line { font: 500 .66rem/1.2 "Spectral", Georgia, serif; letter-spacing: .2em; text-transform: uppercase; color: #c9b48d; }
.w-story-title { font: italic 400 clamp(1.05rem, 1.35vw, 1.28rem)/1.25 "Spectral", Georgia, serif; letter-spacing: .01em; color: #f4ead6; }
.w-story-teaser { font: 300 clamp(.82rem, .95vw, .92rem)/1.4 "Spectral", Georgia, serif; color: #cfc5b3; }
.w-story-teaser:empty { display: none; }
.w-story-read { flex: none; align-self: flex-end; font: italic 300 .85rem/1 "Spectral", Georgia, serif; color: #c9bfae; opacity: .75; transition: opacity .3s ease, color .3s ease; }
.w-story:hover .w-story-read { opacity: 1; color: #fff; }
body.w-titled .w-story, body.w-reading .w-story, body.w-reading .w-name, body.w-reading .w-dock, body.w-reading .w-edge { opacity: 0 !important; pointer-events: none; }
@media (max-width: 640px) { .w-story { gap: .6rem; padding: .65rem .8rem .7rem .7rem; } .w-story-mark { width: 26px; height: 26px; } .w-story-read { display: none; } }

/* Author mode: the story form, in the dock's panel. */
.w-form { display: flex; flex-direction: column; gap: .45rem; padding: 0 .6rem .3rem; min-width: min(360px, calc(100vw - 64px)); }
.w-form label { display: flex; flex-direction: column; gap: .15rem; font: 500 .68rem/1.2 "Spectral", serif; letter-spacing: .12em; text-transform: uppercase; color: #a99f8f; }
.w-form input, .w-form textarea { font: 300 .95rem/1.35 "Spectral", Georgia, serif; color: #efe4cc; background: rgba(255,255,255,.06);
  border: 1px solid rgba(239,228,204,.2); border-radius: 6px; padding: .35rem .5rem; text-transform: none; letter-spacing: 0; }
.w-form textarea { resize: vertical; min-height: 3.2rem; }
.w-form .w-form-row { display: flex; gap: .5rem; justify-content: flex-end; margin-top: .2rem; }
.w-form .w-form-row button { font: inherit; font-size: .9rem; color: #efe4cc; background: rgba(255,255,255,.08); border: 1px solid rgba(239,228,204,.25); border-radius: 999px; padding: .25rem .9rem; cursor: pointer; }
.w-form .w-form-row button.primary { background: rgba(231,214,179,.22); }
.w-form .w-form-note { font: italic 300 .8rem/1.35 "Spectral", serif; color: #a99f8f; text-transform: none; letter-spacing: 0; }

/* The reader: the story's own page, framed over the city, which carries on darkened behind it. */
.w-reader { display: none; }
body.wander .w-reader:not([hidden]) { display: flex; }
.w-reader { position: absolute; inset: 0; z-index: 12; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(6,7,10,.72), rgba(3,4,6,.92)); backdrop-filter: blur(3px);
  animation: w-reader-in .9s ease both; }
@keyframes w-reader-in { from { opacity: 0; } to { opacity: 1; } }
.w-reader-box { position: relative; display: flex; flex-direction: column; width: min(880px, 94vw); height: min(92vh, 1100px);
  background: #121318; border: 1px solid rgba(239,228,204,.16); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.w-reader-head { display: flex; align-items: center; gap: 1rem; padding: .7rem 1rem .6rem 1.2rem; border-bottom: 1px solid rgba(239,228,204,.12); }
.w-reader-title { flex: 1; font: italic 400 1rem/1.2 "Spectral", Georgia, serif; color: #efe4cc; letter-spacing: .03em; }
.w-reader-out { font: 300 .8rem/1 "Spectral", Georgia, serif; color: #a99f8f; text-decoration: none; }
.w-reader-out:hover { color: #efe4cc; text-decoration: underline; }
.w-reader-close { border: 0; background: none; color: #c9bfae; font: 300 1.6rem/1 "Spectral", Georgia, serif; cursor: pointer; padding: 0 .2rem; }
.w-reader-close:hover { color: #fff; }
.w-reader iframe { position: relative; z-index: 1; flex: 1; width: 100%; border: 0; background: transparent; }
/* Behind the frame until the story's page paints over it: a way out if the site won't be framed. */
.w-reader-wait { position: absolute; left: 0; right: 0; top: 45%; z-index: 0; padding: 0 2rem; text-align: center;
  font: italic 300 1rem/1.6 "Spectral", Georgia, serif; color: #8f8778; }
.w-reader-wait a { color: #c9bfae; }
@media (max-width: 640px) { .w-reader-box { width: 100vw; height: 100%; border: 0; } .w-reader-out { display: none; } }

/* Phones held upright: a quiet card asking for landscape, over everything; turning the phone lifts it. */
.w-turn { display: none; }
@media (orientation: portrait) and (max-width: 900px) {
  body.wander .w-turn { display: flex; }
}
.w-turn { position: fixed; inset: 0; z-index: 40; flex-direction: column; align-items: center; justify-content: center; gap: .6rem;
  padding: 2rem; text-align: center; background: radial-gradient(ellipse at center, #15171e 0%, #07080b 100%); color: #efe4cc; }
.w-turn svg { width: 84px; height: 84px; fill: none; stroke: #e7d6b3; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  animation: w-turn 3.2s ease-in-out infinite; transform-origin: 50% 50%; }
@keyframes w-turn { 0%, 25% { transform: rotate(0deg); } 55%, 80% { transform: rotate(-90deg); } 100% { transform: rotate(0deg); } }
.w-turn-title { margin: .4rem 0 0; font: 400 1.05rem/1.2 "Spectral", Georgia, serif; letter-spacing: .2em; text-transform: uppercase; }
.w-turn-line { margin: 0; max-width: 18rem; font: italic 300 1rem/1.5 "Spectral", Georgia, serif; color: #c9bfae; }
/* The published game: no way into the old story screen or the author tools. */
html.published #w-old-start, html.published .w-author, html.published #author { display: none !important; }
/* The title on short screens (a phone held sideways): smaller and tighter, so it all fits. */
@media (max-height: 520px) {
  .w-title h1.w-world { font-size: clamp(2rem, 11vh, 3.4rem); margin-bottom: .35rem; }
  .w-year { margin-bottom: .7rem; }
  .w-district { font-size: 1.05rem; margin-bottom: .55rem; }
  .w-invite { font-size: .92rem; line-height: 1.45; margin-bottom: .9rem; max-width: 40em; }
  .w-ways { gap: .6rem; }
  .w-ways button { padding: .6rem 1.1rem; font-size: .92rem; }
  .w-next { margin-top: .7rem; font-size: .82rem; }
  .w-phones { margin-top: .4rem; font-size: .78rem; }
}

/* A window's set list: a small dark card by the window, the songs in the italic of the place names. */
.w-setlist { display: none; }
body.wander .w-setlist:not([hidden]) { display: flex; }
.w-setlist { position: absolute; z-index: 8; flex-direction: column; gap: .1rem; min-width: 220px; max-width: min(320px, 80vw);
  padding: .85rem .6rem .6rem; border-radius: 12px; color: #efe4cc; background: rgba(9,10,15,.82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(239,228,204,.16); box-shadow: 0 14px 40px rgba(0,0,0,.45); animation: w-setlist-in .35s ease both; }
@keyframes w-setlist-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.w-setlist-title { margin: 0 .6rem .45rem; font: 500 .66rem/1.2 "Spectral", serif; letter-spacing: .2em; text-transform: uppercase; color: #c9b48d; }
.w-song { display: flex; align-items: center; gap: .65rem; width: 100%; text-align: left; border: 0; background: transparent; color: inherit; cursor: pointer;
  padding: .42rem .6rem; border-radius: 8px; font: italic 400 1.02rem/1.25 "Spectral", Georgia, serif; }
.w-song:hover:not(:disabled) { background: rgba(255,255,255,.07); }
.w-song:disabled { opacity: .45; cursor: default; font-size: .9rem; }
.w-song-mark { flex: none; width: 0; height: 0; border-left: 7px solid #e7d6b3; border-top: 5px solid transparent; border-bottom: 5px solid transparent; opacity: .8; }
.w-song.on { color: #fff; background: rgba(226,169,91,.14); }
.w-song.on .w-song-mark { width: 9px; height: 10px; border: 0; border-left: 3px solid #e7c58f; border-right: 3px solid #e7c58f; }
.w-setlist-note { margin: .3rem .6rem 0; font: italic 300 .78rem/1.3 "Spectral", serif; color: #a99f8f; }
.w-setlist-close { position: absolute; top: .35rem; right: .45rem; border: 0; background: none; color: #a99f8f; font: 300 1.1rem/1 "Spectral", serif; cursor: pointer; }
.w-setlist-close:hover { color: #fff; }

/* The paintings can't be picked up and dragged (the browser's "ghost" copy of an image), nor selected. */
.painting, .painting img, .painting canvas { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }

/* In the set list: the playing song's progress (drag to move through it) and the songs' own volume. */
.w-np { display: none; align-items: center; gap: .6rem; margin: .45rem .6rem .1rem; }
.w-np.on { display: flex; }
.w-np-time { flex: none; font: 300 .78rem/1 "Spectral", serif; color: #c9bfae; font-variant-numeric: tabular-nums; min-width: 5.6em; text-align: right; }
.w-vol { display: flex; align-items: center; gap: .6rem; margin: .5rem .6rem .15rem; padding-top: .5rem; border-top: 1px solid rgba(239,228,204,.1);
  font: 500 .64rem/1 "Spectral", serif; letter-spacing: .18em; text-transform: uppercase; color: #a99f8f; }
.w-setlist input[type=range] { flex: 1; min-width: 0; height: 18px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.w-setlist input[type=range]::-webkit-slider-runnable-track { height: 2px; background: rgba(239,228,204,.28); border-radius: 2px; }
.w-setlist input[type=range]::-moz-range-track { height: 2px; background: rgba(239,228,204,.28); border-radius: 2px; }
.w-setlist input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 11px; margin-top: -4.5px; border-radius: 50%; background: #e7c58f; border: 0; }
.w-setlist input[type=range]::-moz-range-thumb { width: 11px; height: 11px; border-radius: 50%; background: #e7c58f; border: 0; }

/* The map: names always shown, small, with icons for what each place offers. */
.w-pin > span { opacity: 1; display: flex; align-items: center; gap: .37rem; font-size: .77rem; padding: .23rem .45rem; bottom: calc(100% - 2px);
  background: rgba(10,15,26,.78); letter-spacing: .03em; }
.w-pin > span b { font-weight: 400; }
.w-pin > span em { display: flex; gap: .2rem; font-style: normal; }
.w-pin:hover > span, .w-pin.here > span { background: rgba(10,15,26,.95); }
.w-pin.here > span b { color: #fff3da; }
.w-pin.dragging { cursor: grabbing; z-index: 3; }
body.w-pinning .w-pin { cursor: grab; }
.w-ic { display: inline-flex; width: 12px; height: 12px; }
.w-ic svg { width: 100%; height: 100%; fill: none; stroke: #e7c58f; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
/* The invitation box on the map: an invitation to explore, and what the icons promise. */
.w-map-key { position: absolute; display: flex; flex-direction: column; gap: .3rem; width: min(17.5%, 215px); padding: .65rem .75rem .7rem;
  border-radius: 8px; background: rgba(10,15,26,.8); border: 1px solid rgba(239,228,204,.14); box-shadow: 0 8px 24px rgba(0,0,0,.35);
  color: #e9dfca; pointer-events: none; }
.w-map-key:empty { display: none; }
.w-key-title { margin: 0 0 .05rem; font: italic 400 clamp(.88rem, 1.1vw, 1.06rem)/1.2 "Spectral", Georgia, serif; color: #f4ead6; }
.w-key-line { margin: 0 0 .12rem; font: 300 clamp(.66rem, .78vw, .77rem)/1.32 "Spectral", serif; color: #c9bfae; }
.w-key-row { display: flex; align-items: flex-start; gap: .42rem; margin: 0; font: 300 clamp(.66rem, .78vw, .77rem)/1.3 "Spectral", serif; color: #e2d7c2; }
.w-key-row .w-ic { flex: none; width: 13px; height: 13px; margin-top: .03rem; }
/* Without a list of places under it, the map takes the room. */
.w-map-box:not(.has-list) .w-map-frame { width: min(94vw, calc(90vh * 16 / 9)); }
/* While the map is open, the author bar moves to the left side, clear of the map's places. */
body.w-mapopen .w-author { left: 12px; top: 50%; bottom: auto; transform: translateY(-50%); flex-direction: column; align-items: stretch;
  max-width: 170px; z-index: 10; }
body.w-mapopen .w-author .w-help, body.w-mapopen .w-author .w-todo { font-size: .78rem; }

/* "Show unpainted" belongs to placing the map: only shown while the map is open. */
#w-unpainted-btn { display: none; }
body.w-mapopen #w-unpainted-btn { display: inline-block; }
