/* Wilt Ward. Mobile first: everything is sized in rem so the text-size setting scales the whole UI.
   The look: dark glass over the world, warm ink, thin gold rules, serif display type. */
:root {
  --bg: #12101a; --panel: #1b1725; --card: rgba(255, 255, 255, .045); --line: rgba(217, 164, 65, .28); --ink: #efe6d2; --dim: #a9a0b6;
  --gold: #d9a441; --gold-hi: #f3d691; --gold-lo: #8a6424; --good: #7fc48f; --bad: #e0705f; --mana: #6f9fe8; --vigor: #cf5f58;
  --glass: rgba(18, 15, 26, .72); --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  font-size: 17px;
}
:root[data-cb="safe"] { --good: #4aa3ff; --bad: #ff9d2e; --vigor: #ff9d2e; --mana: #4aa3ff; }
:root[data-cb="contrast"] { --bg: #000; --panel: #050505; --card: #161616; --line: #fff; --ink: #fff; --dim: #e6e6e6; --gold: #ffe600; --gold-hi: #fff59a; --good: #5cff8a; --bad: #ff7a7a; --glass: rgba(0, 0, 0, .9); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.5; overscroll-behavior: none; }
body { user-select: none; -webkit-user-select: none; touch-action: none; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
input, textarea { font: inherit; font-size: max(16px, 1rem); color: var(--ink); background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: .5rem; padding: .7rem .8rem; width: 100%; user-select: text; -webkit-user-select: text; outline: none; }
input:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217, 164, 65, .18); }
input::placeholder, textarea::placeholder { color: rgba(239, 230, 210, .35); }
canvas#c, canvas#o { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
canvas#o { pointer-events: none; }
svg { display: block; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud > * { pointer-events: auto; }
#hud::before { content: ""; position: absolute; inset: 0 0 auto; height: 7.5rem; background: linear-gradient(rgba(10, 8, 16, .55), transparent); pointer-events: none; }
#top { position: absolute; top: calc(var(--safe-t) + .45rem); left: .6rem; right: .6rem; max-width: 30rem; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: .4rem .5rem; pointer-events: none; }
#clock { grid-column: 1 / -1; justify-self: center; font-family: var(--serif); font-size: .84rem; letter-spacing: .03em; white-space: nowrap; color: var(--ink);
  padding: .22rem 1rem .26rem; background: var(--glass); border: 1px solid var(--line); border-radius: 999px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.bar { position: relative; height: .82rem; background: rgba(8, 6, 14, .7); border-radius: 999px; overflow: hidden; border: 1px solid rgba(217, 164, 65, .45); box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.bar i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; transition: width .25s; }
.bar.vigor i { background: linear-gradient(#e98a7c, var(--vigor) 55%, #8f3a3a); } .bar.mana i { background: linear-gradient(#a9c8ff, var(--mana) 55%, #3c5fa8); }
/* near a living root, the Heart, or inside a rite's ring: the edges of the sight darken to violet and beat as the thing beats */
#blight { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 1.8s; box-shadow: inset 0 0 24vmin 3vmin rgba(118, 58, 204, .5); }
body.blight #blight { opacity: .75; animation: wiltbeat 2.99s ease-in-out infinite; } body.blight.rite #blight { opacity: 1; }
body.cine #blight, body.still #blight { animation: none; } body.cine #blight { opacity: 0 !important; }
@keyframes wiltbeat { 0%, 100% { filter: opacity(.5); } 10% { filter: opacity(1); } 22% { filter: opacity(.6); } 32% { filter: opacity(.92); } 55% { filter: opacity(.5); } }
/* a rite in progress: one long bar under the other two, and the objective steps down to make room */
.bar.rite { grid-column: 1 / -1; height: .95rem; border-color: rgba(255, 226, 150, .7); box-shadow: 0 0 10px rgba(180, 120, 255, .45), 0 1px 4px rgba(0, 0, 0, .5); }
.bar.rite i { background: linear-gradient(90deg, #7a3cc8, #c890ff 45%, #ffe9a8); box-shadow: 0 0 8px rgba(255, 233, 168, .7); } .bar.rite span { line-height: .9rem; letter-spacing: .2em; }
body.rite #objective, body.rite #legendbtn { top: calc(var(--safe-t) + 5.1rem); }
.bar span { position: absolute; inset: 0; font-size: .56rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; text-align: center; line-height: .78rem; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
#objective { position: absolute; top: calc(var(--safe-t) + 3.75rem); left: .6rem; max-width: min(74vw, 22rem); text-align: left; font-family: var(--serif); font-size: .84rem; line-height: 1.35;
  background: linear-gradient(90deg, rgba(18, 15, 26, .82), rgba(18, 15, 26, .45)); border-left: 2px solid var(--gold); border-radius: 0 .5rem .5rem 0; padding: .4rem .8rem .45rem .65rem; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
#objective small { display: block; margin-top: .2rem; color: var(--gold); font-family: system-ui, sans-serif; font-size: .72rem; letter-spacing: .02em; }
#legendbtn { position: absolute; top: calc(var(--safe-t) + 3.75rem); right: .6rem; width: 2.3rem; height: 2.3rem; border-radius: 50%; font-family: var(--serif); font-size: 1.15rem; color: var(--gold); background: rgba(18, 15, 26, .78); border: 1px solid var(--gold-lo); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
ul.todo { list-style: none; margin: .3rem 0; padding: 0; } ul.todo li { position: relative; padding-left: 1.5rem; margin: .25rem 0; } ul.todo li::before { content: ''; position: absolute; left: .1rem; top: .28em; width: .8rem; height: .8rem; border: 1.5px solid var(--gold-lo); border-radius: 50%; } ul.todo li.done { color: var(--dim); } ul.todo li.done::before { background: var(--gold); border-color: var(--gold); }
.card > .ico svg { width: 100%; height: 100%; }
#objective span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

#nav { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; padding: .25rem .4rem calc(var(--safe-b) + .25rem);
  background: linear-gradient(transparent, rgba(10, 8, 16, .8) 45%); }
#nav button { flex: 1; max-width: 6rem; min-height: 3.4rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .12rem; color: var(--ink); border-radius: .8rem; }
#nav b { display: block; } #nav b svg { width: 1.55rem; height: 1.55rem; color: var(--gold-hi); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .8)); }
#nav span { font-family: var(--serif); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); text-shadow: 0 1px 2px #000; }
#nav button:active { background: rgba(217, 164, 65, .16); }

#actbtn, #fightbtn, #morebtn, #radial button { position: absolute; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .05rem; color: var(--ink);
  background: radial-gradient(circle at 50% 35%, #33293f, #15111d 72%); border: 1.5px solid var(--gold);
  box-shadow: 0 0 0 3px rgba(12, 9, 18, .75), 0 0 0 4px rgba(217, 164, 65, .35), 0 6px 16px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .12); transition: transform .08s; touch-action: none; }
/* fight: always there, always the same place */
#fightbtn { right: .9rem; bottom: calc(var(--safe-b) + 4.7rem); width: 5.4rem; height: 5.4rem; border-color: #f0c9a0; }
#fightbtn.foe { border-color: #ffb0a0; box-shadow: 0 0 0 3px rgba(12, 9, 18, .75), 0 0 0 4px rgba(224, 112, 95, .6), 0 0 22px rgba(224, 112, 95, .7), inset 0 1px 0 rgba(255, 255, 255, .12); animation: foe .7s infinite alternate; }
#fightbtn.idle { opacity: .72; }
@keyframes foe { to { transform: scale(1.07); } }
/* whatever you are standing next to */
#actbtn { right: 1.3rem; bottom: calc(var(--safe-b) + 10.9rem); width: 4.6rem; height: 4.6rem; }
/* everything else: tap for the list, hold and drag for the wheel */
#morebtn { left: .9rem; bottom: calc(var(--safe-b) + 4.7rem); width: 4.6rem; height: 4.6rem; border-color: #9fc0ff; box-shadow: 0 0 0 3px rgba(12, 9, 18, .75), 0 0 0 4px rgba(111, 159, 232, .4), 0 6px 16px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .12); }
#morebtn.open { border-color: #fff; }
#actbtn b svg, #fightbtn b svg { width: 1.9rem; height: 1.9rem; color: var(--gold-hi); } #morebtn b svg { width: 1.6rem; height: 1.6rem; color: #cfe0ff; }
#actbtn span, #fightbtn span, #morebtn span, #radial span { font-family: var(--serif); font-size: .62rem; letter-spacing: .09em; text-transform: uppercase; color: var(--gold-hi); }
#morebtn span { color: #cfe0ff; }
#actbtn:active, #fightbtn:active { transform: scale(.93); }
#radial { position: absolute; left: 0; bottom: 0; width: 100%; height: 100%; pointer-events: none; background: radial-gradient(circle at 3.2rem calc(100% - 7rem - var(--safe-b)), rgba(8, 6, 14, .7), rgba(8, 6, 14, 0) 16rem); }
#radial button { width: 3.7rem; height: 3.7rem; border-color: #9fc0ff; margin: -1.85rem 0 0 -1.85rem; pointer-events: none; transition: transform .08s, border-color .08s; }
#radial button b svg { width: 1.4rem; height: 1.4rem; color: #cfe0ff; } #radial span { font-size: .5rem; color: #cfe0ff; letter-spacing: .04em; }
#radial button.hot { transform: scale(1.22); border-color: #fff; background: radial-gradient(circle at 50% 35%, #4a4266, #1c1830 72%); } #radial button.low { opacity: .45; }

#tray { position: absolute; right: .6rem; left: .6rem; bottom: calc(var(--safe-b) + 10.2rem); display: grid; grid-template-columns: repeat(auto-fill, minmax(4.6rem, 1fr)); gap: .45rem;
  background: rgba(18, 15, 26, .9); border: 1px solid var(--line); border-radius: 1rem; padding: .6rem; max-width: 30rem; margin-left: auto; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
#tray button { min-height: 4.4rem; border-radius: .7rem; background: var(--card); border: 1px solid rgba(255, 255, 255, .07); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: .3rem; }
#tray button:active { border-color: var(--gold); }
#tray button b { font-size: 1.45rem; font-weight: 400; } #tray button span { font-family: var(--serif); font-size: .7rem; text-align: center; line-height: 1.15; }
#tray button small { font-size: .62rem; color: #a9c8ff; letter-spacing: .04em; } #tray button.low { opacity: .4; }

#toasts { position: fixed; top: calc(var(--safe-t) + 9rem); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: .35rem; pointer-events: none; z-index: 15; padding: 0 .8rem; }
.toast { font-family: var(--serif); background: rgba(18, 15, 26, .88); border: 1px solid var(--line); border-radius: .6rem; padding: .42rem .95rem; font-size: .88rem; max-width: 26rem; text-align: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: toast .25s; transition: opacity .4s; }
.toast.out { opacity: 0; }
@keyframes toast { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- Panels ---------- */
#panel { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; padding-top: var(--safe-t);
  background: radial-gradient(120% 60% at 50% 0%, #2a2238 0%, var(--panel) 55%, #110e18 100%); animation: fade .18s; }
@keyframes fade { from { opacity: 0; } }
#panel header { display: grid; grid-template-columns: 2.7rem 1fr 2.7rem; align-items: center; gap: .4rem; padding: .7rem .7rem .6rem; position: relative; }
#panel header::after { content: ""; position: absolute; left: 12%; right: 12%; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
#panel h2 { grid-column: 2; margin: 0; font-family: var(--serif); font-weight: 500; font-size: 1.25rem; letter-spacing: .14em; text-transform: uppercase; text-align: center; color: var(--gold-hi); }
#close, #back { width: 2.7rem; height: 2.7rem; border-radius: 50%; border: 1px solid var(--line); background: rgba(0, 0, 0, .25); color: var(--gold-hi); font-size: 1rem; }
#back { grid-column: 1; font-size: 1.6rem; line-height: 1; } #close { grid-column: 3; } #close:active, #back:active { background: rgba(217, 164, 65, .2); }
#pbody { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 1rem .9rem calc(var(--safe-b) + 2rem); touch-action: pan-y; max-width: 42rem; width: 100%; margin: 0 auto; }
h3 { font-family: var(--serif); font-weight: 500; font-size: .86rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin: 1.5rem 0 .6rem; display: flex; align-items: center; gap: .7rem; }
h3::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
h3:first-child { margin-top: .2rem; }
h3 .dim { text-transform: none; letter-spacing: 0; }
p { margin: .4rem 0; } .dim { color: var(--dim); } .small { font-size: .84rem; }
.card { background: var(--card); border: 1px solid rgba(255, 255, 255, .06); border-left: 2px solid var(--line); border-radius: .5rem; padding: .8rem .9rem; margin-bottom: .55rem; display: flex; gap: .8rem; align-items: flex-start; }
.card > .ico { font-size: 1.6rem; line-height: 1.25; flex: none; width: 2.2rem; text-align: center; }
.card > div { flex: 1; min-width: 0; } .card h4 { margin: 0 0 .15rem; font-family: var(--serif); font-weight: 600; font-size: 1.04rem; letter-spacing: .01em; } .card p { margin: .15rem 0; font-size: .88rem; color: var(--dim); }
.card p b { color: var(--ink); } .card.off { opacity: .45; border-left-color: transparent; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 2.9rem; padding: .5rem 1.15rem; border-radius: .45rem; margin: .25rem .35rem .25rem 0;
  font-family: var(--serif); font-weight: 600; font-size: .92rem; letter-spacing: .07em; text-transform: uppercase; color: #2a1c06;
  background: linear-gradient(#f3d691, var(--gold) 55%, #b9832c); border: 1px solid #f6e0a8; box-shadow: 0 2px 8px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .45); transition: transform .08s; }
.btn.alt { background: rgba(0, 0, 0, .28); color: var(--gold-hi); border: 1px solid var(--line); box-shadow: none; } .btn.wide { width: 100%; margin-right: 0; }
.btn.sel { border-color: var(--gold-hi); background: rgba(217, 164, 65, .2); } .btn:active { transform: scale(.97); } .btn[disabled] { opacity: .45; }
.card .btn { min-height: 2.4rem; font-size: .78rem; padding: .35rem .9rem; margin-top: .45rem; }
.tabs { display: flex; margin-bottom: 1rem; border-bottom: 1px solid var(--line); } .tabs .btn { flex: 1; margin: 0; border-radius: 0; border: 0; border-bottom: 2px solid var(--gold); background: none; box-shadow: none; color: var(--gold-hi); }
.tabs .btn.alt { border-bottom-color: transparent; color: var(--dim); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.grid .btn { margin: 0; min-height: 5.4rem; flex-direction: column; gap: .3rem; font-size: .8rem; } .grid .btn b { font-size: 1.6rem; font-weight: 400; color: var(--gold); }
.meter { height: .4rem; background: rgba(0, 0, 0, .45); border-radius: 999px; overflow: hidden; margin: .4rem 0; position: relative; }
.meter i { position: absolute; top: 0; bottom: 0; left: 0; background: linear-gradient(90deg, #4f8f63, var(--good)); border-radius: 999px; }
.meter.wilt i { background: repeating-linear-gradient(135deg, #8a5aa8, #8a5aa8 6px, #6b4288 6px, #6b4288 12px); }
:root[data-cb="safe"] .meter.wilt i, :root[data-cb="contrast"] .meter.wilt i { background: repeating-linear-gradient(135deg, #ff9d2e, #ff9d2e 6px, #222 6px, #222 12px); }
.day { font-family: var(--serif); color: var(--gold); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; margin: 1.3rem 0 .4rem; }
.entry { font-family: var(--serif); padding: .4rem .1rem .4rem .8rem; border-left: 1px solid rgba(255, 255, 255, .14); margin-bottom: .3rem; font-size: .98rem; line-height: 1.5; }
.entry.story { border-left: 2px solid var(--gold); color: #fff6de; } .entry.world { border-left-color: var(--mana); font-style: italic; color: #cfd8ee; }
label.row { display: flex; align-items: center; gap: .7rem; min-height: 2.9rem; } label.row input { width: 1.4rem; height: 1.4rem; flex: none; accent-color: var(--gold); }
.field { margin: .6rem 0; } .field span { display: block; font-family: var(--serif); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin-bottom: .3rem; } .field em { text-transform: none; letter-spacing: 0; font-style: italic; }

/* map */
.mapscroll { overflow: auto; border-radius: .5rem; border: 1px solid var(--gold-lo); max-height: 60vh; touch-action: pan-x pan-y; background: #1c1a24; box-shadow: 0 0 0 4px rgba(0, 0, 0, .3), inset 0 0 40px rgba(0, 0, 0, .5); }
.mapwrap { position: relative; width: 200%; aspect-ratio: 1; } .mapwrap.out { width: 100%; }
.mapwrap canvas { width: 100%; height: 100%; image-rendering: pixelated; display: block; filter: sepia(.28) saturate(.85) contrast(1.05); }
.mk { position: absolute; transform: translate(-50%, -50%); width: 2.2rem; height: 2.2rem; border-radius: 50%; font-size: 1.1rem; display: flex; align-items: center; justify-content: center;
  background: rgba(18, 14, 30, .7); border: 1.5px solid rgba(217, 164, 65, .5); box-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.mk.on { border-color: #8fe0ff; box-shadow: 0 0 10px rgba(143, 224, 255, .6); } .mk.sel { border-color: var(--gold-hi); background: rgba(18, 14, 30, .95); transform: translate(-50%, -50%) scale(1.15); }
.mk.me { background: var(--gold-hi); border: 2px solid #fff; width: .9rem; height: .9rem; font-size: 0; pointer-events: none; z-index: 2; box-shadow: 0 0 0 4px rgba(243, 214, 145, .3); }
.mk.quest { width: 1.5rem; height: 1.5rem; font-size: .8rem; background: var(--gold); border-color: #fff; pointer-events: none; animation: pulse 1.2s infinite alternate; }
@keyframes pulse { to { transform: translate(-50%, -50%) scale(1.25); } }

/* ---------- Dialogue ---------- */
#dialog { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; background: linear-gradient(transparent 20%, rgba(8, 6, 14, .7)); }
.sheet { width: 100%; max-width: 38rem; max-height: 80vh; overflow-y: auto; touch-action: pan-y; position: relative;
  background: linear-gradient(#241d32, #171320); border: 1px solid var(--line); border-bottom: 0; border-radius: .9rem .9rem 0 0; padding: 1.2rem 1.15rem calc(var(--safe-b) + 1.1rem);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .6); animation: rise .22s ease-out; }
.sheet::before { content: ""; position: absolute; left: 18%; right: 18%; top: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--gold-hi), transparent); }
@keyframes rise { from { transform: translateY(30px); opacity: 0; } }
.who { font-family: var(--serif); font-size: 1.05rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-hi); margin-bottom: .7rem; display: flex; align-items: center; gap: .7rem; }
.who b { font-size: 1.7rem; font-weight: 400; width: 2.8rem; height: 2.8rem; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); }
.text { white-space: pre-wrap; font-family: var(--serif); font-size: 1.06rem; line-height: 1.6; margin-bottom: 1rem; color: #f6efdf; }
.opts { display: flex; flex-direction: column; gap: .45rem; }
.opts button { text-align: left; min-height: 3rem; padding: .65rem .9rem .65rem 2rem; border-radius: .45rem; background: rgba(0, 0, 0, .25); border: 1px solid rgba(217, 164, 65, .3); font-size: .95rem; position: relative; }
.opts button::before { content: "›"; position: absolute; left: .8rem; top: 50%; transform: translateY(-54%); color: var(--gold); font-size: 1.3rem; }
.opts button:active { background: rgba(217, 164, 65, .18); border-color: var(--gold); }
.opts button.leave { color: var(--dim); text-align: center; padding-left: .9rem; border-color: rgba(255, 255, 255, .1); font-family: var(--serif); letter-spacing: .1em; text-transform: uppercase; font-size: .78rem; } .opts button.leave::before { content: none; }

/* ---------- Title: the world shows through ---------- */
#title { position: fixed; inset: 0; z-index: 50; overflow-y: auto; touch-action: pan-y; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: calc(var(--safe-t) + 2.2rem) 1.3rem calc(var(--safe-b) + 1.4rem);
  background: linear-gradient(rgba(10, 8, 16, .82) 0%, rgba(10, 8, 16, .25) 26%, rgba(10, 8, 16, 0) 42%, rgba(10, 8, 16, .5) 62%, rgba(10, 8, 16, .94) 100%); }
#title .logo { text-align: center; color: var(--gold-hi); animation: fade 1.2s; }
#title .sigil { display: flex; justify-content: center; color: var(--gold); filter: drop-shadow(0 0 12px rgba(243, 214, 145, .5)); }
#title h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(2.4rem, 12vw, 3.6rem); letter-spacing: .2em; text-transform: uppercase; margin: .5rem 0 0; padding-left: .2em; line-height: 1.1;
  background: linear-gradient(#fff3cf, var(--gold) 60%, #a8742a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 10px rgba(0, 0, 0, .7)); }
#title .rule { display: flex; align-items: center; justify-content: center; gap: .6rem; margin: .6rem auto 0; width: 13rem; }
#title .rule::before, #title .rule::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); } #title .rule::after { transform: scaleX(-1); }
#title .rule i { width: .42rem; height: .42rem; background: var(--gold-hi); transform: rotate(45deg); }
#title .tag { font-family: var(--serif); font-style: italic; font-size: 1rem; color: var(--ink); margin: .55rem 0 0; text-shadow: 0 1px 6px #000; }
#title .menu { width: 100%; max-width: 22rem; display: flex; flex-direction: column; gap: .5rem; animation: rise .6s .2s both; }
#title .btn { margin: 0; min-height: 3.2rem; flex-direction: column; gap: .05rem; }
#title .btn small { font-family: system-ui, sans-serif; font-weight: 400; font-size: .7rem; letter-spacing: .02em; text-transform: none; opacity: .75; }
#title .btn.alt { background: rgba(14, 11, 20, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
#title .newform { background: rgba(14, 11, 20, .72); border: 1px solid var(--line); border-radius: .6rem; padding: .5rem .9rem .9rem; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
#title .fine { text-align: center; font-size: .72rem; color: var(--dim); margin: .5rem 0 0; }

@media (min-width: 720px) {
  #tray { left: auto; width: 26rem; }
  .mapwrap { width: 100%; } .mapscroll { max-height: none; }
  #title { justify-content: center; gap: 3rem; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01s !important; transition: none !important; } }

/* ---------- drawn icons ---------- */
#clock { display: inline-flex; align-items: center; gap: .4rem; } #clock i { display: inline-flex; color: var(--gold-hi); } #clock i svg { width: 1rem; height: 1rem; } #clock i.gr { margin-left: .5rem; color: var(--gold); }
#tray button b svg { width: 1.6rem; height: 1.6rem; color: #cfe0ff; margin-bottom: .15rem; }
.card > .ico { width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 1px solid var(--line); background: rgba(0, 0, 0, .28); display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 1.2rem; line-height: 1; color: var(--gold-hi); }
.card > .ico svg { width: 1.35rem; height: 1.35rem; color: var(--gold-hi); }
.who b { font-family: var(--serif); font-size: 1.35rem; color: var(--gold-hi); letter-spacing: 0; }
.who b svg { width: 1.5rem; height: 1.5rem; }
.who b.pt { width: 4.6rem; height: 4.6rem; overflow: hidden; border: 1px solid var(--gold); box-shadow: 0 0 0 3px rgba(12, 9, 18, .7), 0 0 0 4px rgba(217, 164, 65, .3), 0 6px 18px rgba(0, 0, 0, .5); }
.who b.pt img, .card > .ico img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.card > .ico:has(img) { width: 3.6rem; height: 3.6rem; padding: 0; overflow: hidden; border-color: var(--gold-lo); }
.mk svg { width: 1.15rem; height: 1.15rem; color: var(--gold-hi); } .mk.on svg { color: #bfeeff; } .mk.quest { font-family: var(--serif); font-weight: 700; color: #2a1c06; }

.mapwrap.out .mk { width: 1.45rem; height: 1.45rem; } .mapwrap.out .mk svg { width: .8rem; height: .8rem; } .mapwrap.out .mk.me { width: .7rem; height: .7rem; }

.mk.bloom { width: .8rem; height: .8rem; background: #9a5cff; border: 1.5px solid #e6d4ff; pointer-events: none; box-shadow: 0 0 8px #9a5cff; }

#title .pair { display: flex; gap: .5rem; } #title .pair .btn { flex: 1; flex-direction: row; font-size: .8rem; padding: .5rem; }
#title .note { text-align: center; font-family: var(--serif); font-size: .9rem; color: var(--gold-hi); background: rgba(14, 11, 20, .72); border: 1px solid var(--line); border-radius: .5rem; padding: .5rem .8rem; margin: 0; }
#title.seen .logo, #title.seen .menu { animation: none; }

/* ---------- cinematics ---------- */
#cine { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
#cine .lb { position: absolute; left: 0; right: 0; height: 11vh; background: #000; transition: transform .7s ease; }
#cine .lb.top { top: 0; transform: translateY(-100%); } #cine .lb.bot { bottom: 0; height: 15vh; transform: translateY(100%); }
#cine.on .lb { transform: none; }
#cinefade { position: absolute; inset: 0; background: #000; opacity: 0; }
#cinecap { position: absolute; left: 8vw; right: 8vw; bottom: 17.5vh; margin: 0; text-align: center; font-family: var(--serif); font-size: clamp(1.25rem, 5.2vw, 1.9rem); line-height: 1.35; color: #f3ead6; text-shadow: 0 2px 14px rgba(0, 0, 0, .9), 0 0 3px rgba(0, 0, 0, .9); opacity: 0; transform: translateY(.5rem); transition: opacity .7s ease, transform .9s ease; }
#cinecap.on { opacity: 1; transform: none; }
#cineskip { position: absolute; right: 1rem; bottom: calc(var(--safe-b) + 1.1rem); pointer-events: auto; font-family: var(--serif); letter-spacing: .14em; text-transform: uppercase; font-size: .74rem; color: rgba(243, 234, 214, .6); padding: .7rem 1rem; border: 1px solid rgba(243, 234, 214, .22); border-radius: 2rem; opacity: 0; transition: opacity .6s .8s; }
#cine.on #cineskip { opacity: 1; }
body.cine #hud, body.cine #toasts, body.cine:not(.titled) #namecard { opacity: 0 !important; pointer-events: none; }
body.titled #namecard { z-index: 41; top: 14.5vh; }
body.titled #namecard::before { content: ''; position: absolute; inset: -2.2rem 0 -1.6rem; z-index: -1; background: linear-gradient(transparent, rgba(8, 6, 14, .5) 35%, rgba(8, 6, 14, .5) 65%, transparent); }
body.cine #o { opacity: 0; }
#hud, #toasts { transition: opacity .5s; }
/* a place name, the first time you arrive */
#namecard { position: fixed; left: 0; right: 0; top: 27vh; z-index: 12; text-align: center; pointer-events: none; opacity: 0; transition: opacity 1.1s ease; }
#namecard.on { opacity: 1; }
#namecard b { display: block; font-family: var(--serif); font-weight: 400; font-size: clamp(1.7rem, 8vw, 2.8rem); letter-spacing: .16em; text-transform: uppercase; color: #f6ecd2; text-shadow: 0 2px 18px rgba(0, 0, 0, .85), 0 0 4px rgba(0, 0, 0, .8); }
#namecard b::after { content: ''; display: block; width: 9rem; height: 1px; margin: .55rem auto .45rem; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
#namecard i { font-family: var(--serif); font-size: .95rem; letter-spacing: .08em; color: rgba(246, 236, 210, .85); text-shadow: 0 1px 8px rgba(0, 0, 0, .9); }

/* ---------- the chart ---------- */
.mapbox { position: relative; overflow: hidden; height: min(64vh, 108vw); border-radius: .4rem; border: 1px solid var(--gold-lo); background: #cdbb8f; touch-action: none; box-shadow: 0 0 0 4px rgba(0, 0, 0, .3), inset 0 0 30px rgba(60, 40, 10, .35); cursor: grab; margin: 0 -.3rem; }
.mapbox .mapwrap { position: absolute; left: 0; top: 0; width: 100%; aspect-ratio: 1; transform-origin: 0 0; will-change: transform; }
.mapbox .mapwrap canvas { width: 100%; height: 100%; display: block; image-rendering: auto; filter: none; }
.mapbox .mk { transform: translate(-50%, -50%) scale(calc(1 / var(--k, 1))); }
.mapbox .mk.site { width: 2.6rem; height: 2.6rem; background: none; border: 0; box-shadow: none; }
.mapbox .mk.site.sel { border: 2px solid #7a2a1a; background: rgba(122, 42, 26, .12); transform: translate(-50%, -50%) scale(calc(1 / var(--k, 1))); }
.mapwrap .trail { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.trail polyline { fill: none; stroke: #7a2a1a; stroke-width: 2.6px; stroke-dasharray: .1 7; stroke-linecap: round; vector-effect: non-scaling-stroke; opacity: .9; }
.mapbox .mk.me { background: #7a2a1a; border: 2px solid #f6ecd2; width: .8rem; height: .8rem; box-shadow: 0 0 0 5px rgba(122, 42, 26, .25); }
.mapbox .mk.quest { animation: none; width: 1.25rem; height: 1.25rem; font-size: .75rem; background: var(--gold); border: 2px solid #3d2c1a; color: #3d2c1a; box-shadow: 0 0 0 4px rgba(217, 164, 65, .35); }
.mapbox .mk.bloom { background: #6a3f9a; border: 1.5px solid #f0e4ff; box-shadow: 0 0 0 3px rgba(106, 63, 154, .3); }
.mapbtns { position: absolute; right: .5rem; top: .5rem; display: flex; flex-direction: column; gap: .4rem; }
.mapbtns button { width: 2.5rem; height: 2.5rem; border-radius: 50%; background: rgba(61, 44, 26, .86); color: #f6ecd2; font-family: var(--serif); font-size: 1.4rem; line-height: 1; border: 1px solid rgba(246, 236, 210, .4); display: flex; align-items: center; justify-content: center; }
.mapbtns button svg { width: 1.2rem; height: 1.2rem; }

/* things on the map that are not places: a battle, a giant */
.mapbox .mk.war, .mapbox .mk.hill { width: 1.5rem; height: 1.5rem; background: rgba(246, 236, 210, .85); border: 1.5px solid #7a2a1a; box-shadow: none; pointer-events: none; }
.mapbox .mk.war svg { color: #7a2a1a; width: 1rem; height: 1rem; } .mapbox .mk.hill { border-color: #4a5a3a; } .mapbox .mk.hill svg { color: #4a5a3a; width: 1rem; height: 1rem; }
