/* the world as a site plan: ink on the blog's paper (stars in the dark).
   The bars, labels, side panel and guide chat come from world.css. */
#plan { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; outline: none; }

/* rooms */
.room { fill: var(--card); stroke: var(--ink); stroke-width: 2; }
.room-head { fill: var(--strip); }
.room-title { font: 700 17px var(--title); letter-spacing: .06em; text-transform: uppercase; fill: var(--on-strip); cursor: pointer; }
.room-title:hover { fill: var(--pen); }
.room-line { fill: var(--pen); }
.door { stroke: var(--pen); stroke-width: 5; }
.group { fill: none; stroke: var(--ink); stroke-width: 1; stroke-dasharray: 4 3; opacity: .7; }
.group.away { fill: url(#hatch); stroke: var(--pen-ink); stroke-dasharray: none; opacity: 1; }
.group-title { font: 700 11px var(--title); letter-spacing: .08em; text-transform: uppercase; fill: var(--quiet); }
.group-title.away { fill: var(--pen-ink); }
.row-title { font: 700 12px var(--title); letter-spacing: .08em; text-transform: uppercase; fill: var(--ink); cursor: default; }
.dim { stroke: var(--quiet); stroke-width: 1; fill: none; }
.dim-bg { fill: var(--paper); }
.dim-text { font: 10px var(--mono); fill: var(--quiet); text-anchor: middle; }

/* pages: numbered squares */
.item { cursor: pointer; }
.item rect { fill: var(--card); stroke: var(--ink); stroke-width: 1.4; transition: fill .15s; }
.item .num { font: 10px var(--mono); fill: var(--ink); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.item .name { font: 9.5px var(--mono); fill: var(--quiet); text-anchor: middle; }
.item.active rect { stroke: var(--pen-ink); stroke-width: 2.4; }
.item.lit rect { fill: var(--pen); }
.item.lit .name { fill: var(--ink); }

/* corridors and the plaza */
/* square ends: each piece reaches half its width past its end, so corners close up */
.corridor-edge { fill: none; stroke: var(--ink); stroke-width: 30; stroke-linecap: square; opacity: .5; }
.corridor { fill: none; stroke: var(--zebra); stroke-width: 27; stroke-linecap: square; }
.plaza { fill: var(--card); stroke: var(--ink); stroke-width: 2; }
.plaza-ring { fill: none; stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 5; opacity: .6; }
.dais { fill: color-mix(in srgb, var(--pen) 22%, var(--card)); stroke: var(--ink); stroke-width: 2; }
.dais-ring { fill: none; stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 4; opacity: .5; }
.dais-bridge { fill: var(--card); stroke: var(--ink); stroke-width: 1.5; }
.plaza-title { font: 700 19px var(--title); letter-spacing: .06em; text-transform: uppercase; fill: var(--ink); text-anchor: middle; }
.cross { stroke: var(--pen-ink); stroke-width: 1.5; }

/* the parcours */
.path { fill: none; stroke: var(--ink); stroke-width: 2; }
.stop-g { cursor: pointer; }
.stop { fill: var(--card); stroke: var(--ink); stroke-width: 2; }
.stop.first { fill: var(--pen); }
.stop-g.lit .stop { fill: var(--pen); }
.stop-text { font: 600 13px var(--body); fill: var(--ink); }
.stop-g.lit .stop-text { text-decoration: underline; text-decoration-color: var(--pen); }
.stop-when { font: 10px var(--mono); fill: var(--quiet); }

/* people */
.token-bg { fill: var(--card); }
.token-ring { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.token.me .token-ring { stroke: var(--pen); stroke-width: 3; }
.token.npc .token-ring { stroke: var(--pen-ink); stroke-width: 2.5; }
.token.guide { cursor: pointer; }
.token.guide .token-ring { stroke: var(--pen-ink); stroke-width: 2; stroke-dasharray: 3 2; }
.token.guide.lit .token-ring { stroke: var(--pen); stroke-width: 3; stroke-dasharray: none; }
.lbl { transform-origin: 0 0; }
.lbl.player { padding: .05rem .4rem; }
/* the residents: a dark tag in yellow, with an "npc" badge after the name */
.lbl.player.npc { background: var(--strip); color: var(--pen); }
.lbl.player.npc::after { content: "npc"; margin-left: .4em; padding: 0 .25em; font-size: .8em; background: var(--pen); color: var(--on-pen); }
.lbl.bubble.guide { z-index: 1; font-size: 13px; padding: .25rem .55rem; white-space: nowrap; box-shadow: 3px 3px 0 var(--pen); }
.lbl.bubble { font-size: 14px; padding: .35rem .6rem; }
.lbl.tip { pointer-events: none; max-width: 260px; text-align: center; }
.lbl.tip small { display: block; font: 11px var(--mono); color: var(--quiet); }

/* paper furniture: north arrow and the title block */
.north { position: fixed; right: 1.4rem; top: 4.8rem; z-index: 2; width: 42px; height: 58px; pointer-events: none; }
.titleblock { position: fixed; right: 1rem; bottom: 1rem; z-index: 2; background: var(--card); border: 2px solid var(--ink); font: .68rem var(--mono); color: var(--ink); border-collapse: collapse; pointer-events: none; }
.titleblock td { border: 1px solid var(--ink); padding: .2rem .5rem; }
.titleblock .big { font: 700 1.1rem var(--title); text-transform: uppercase; letter-spacing: .04em; }
.titleblock .k { color: var(--quiet); text-transform: uppercase; font-size: .58rem; }
body.reading .titleblock, body.reading .north { display: none; }
@media (max-width: 980px) { .titleblock, .north { display: none; } }

/* ── juice: things react when you move and touch them ── */
.corridor-flow { fill: none; stroke: var(--pen); stroke-width: 2.5; stroke-linejoin: round; stroke-dasharray: 3 21; opacity: .85; animation: flow 1.3s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -24; } }
.plaza-ring { transform-box: fill-box; transform-origin: center; animation: turn 50s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }
.pulse { fill: none; stroke: var(--pen); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: ping 2.2s ease-out infinite; }
@keyframes ping { from { transform: scale(1); opacity: .9; } to { transform: scale(2.8); opacity: 0; } }
.ripple { fill: none; stroke: var(--pen); stroke-width: 3; transform-box: fill-box; transform-origin: center; animation: ripple .6s ease-out forwards; pointer-events: none; }
.ripple.click { stroke: var(--ink); stroke-width: 1.5; }
@keyframes ripple { from { transform: scale(.15); opacity: 1; } to { transform: scale(1); opacity: 0; } }
.step { fill: var(--ink); opacity: .3; animation: fade 1.6s ease-out forwards; pointer-events: none; }
.step.dash { fill: var(--pen); opacity: 1; }
@keyframes fade { to { opacity: 0; } }
.token-body { transform-box: fill-box; transform-origin: 50% 100%; }
.token-body.pop { animation: pop .5s cubic-bezier(.3, 1.7, .5, 1); }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
.item rect { transform-box: fill-box; transform-origin: center; transition: transform .2s cubic-bezier(.3, 1.7, .5, 1), fill .15s; }
.item.lit rect { transform: scale(1.22) rotate(-6deg); }
.room { transition: stroke .2s, stroke-width .2s; }
.room-g.here .room { stroke: var(--pen); stroke-width: 3.5; }
.room-g.here .room-head { fill: var(--ink); }
.lbl.bubble { animation: bubble .35s cubic-bezier(.3, 1.7, .5, 1); }
@keyframes bubble { from { scale: .3; opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .corridor-flow, .plaza-ring, .token-body.pop, .lbl.bubble { animation: none; }
  .pulse, .ripple, .step { display: none; }
  .item rect { transition: none; }
}
