/* FormaTerra (assets/realms/realms.js): the game's screen, its HUD, the bag and its cards.
 *
 * The look is "a living atlas": deep ocean-slate panels with a brass hairline, bone-coloured text, a serif for titles and a
 * clean sans for the rest. Ordinary land is brass and earth gold; Enchanted ground and rare things glow teal into violet,
 * and only there (focus, selection, the things that are rare). Fonts (Fraunces, Inter: SIL OFL, see assets/fonts) are the
 * game's own files; nothing is fetched from elsewhere. */
@font-face { font-family: Fraunces; font-weight: 600; font-style: normal; font-display: swap; src: url('../fonts/fraunces-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: Fraunces; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/fraunces-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: Inter; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: Inter; font-weight: 500; font-style: normal; font-display: swap; src: url('../fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: Inter; font-weight: 600; font-style: normal; font-display: swap; src: url('../fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: Inter; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/inter-latin-700-normal.woff2') format('woff2'); }

.rl {
  --rl-ink: #ece4d2; --rl-dim: #9aa7b3; --rl-brass: #b89b5e; --rl-brass-hi: #d6bd7f;
  --rl-slate: rgba(15, 26, 36, .88); --rl-slate-2: rgba(22, 38, 58, .88);
  --rl-glass: rgba(15, 26, 36, .78); --rl-line: rgba(184, 155, 94, .6); --rl-soft: rgba(236, 228, 210, .1);
  --rl-accent: #5fe0c8; --rl-accent-2: #9b7bff; --rl-glow: 0 0 0 1px rgba(95, 224, 200, .55), 0 0 14px rgba(123, 157, 255, .35);
  --rl-red: #e0665c; --rl-shadow: 0 18px 50px rgba(3, 8, 14, .55);
  --rl-serif: Fraunces, Georgia, 'Times New Roman', serif; --rl-sans: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  position: relative; overflow: hidden; background: #0b141c; color: var(--rl-ink);
  font-family: var(--rl-sans); user-select: none; -webkit-user-select: none; isolation: isolate;
}
.rl-stage, .rl-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rl-hud { position: absolute; inset: 0; pointer-events: none; }
.rl.bare .rl-hud > :not(.rl-chat) { display: none; }

/* The crosshair: a small plus that reads on bright and dark ground alike. */
.rl-cross { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; transform: translate(-50%, -50%); mix-blend-mode: difference; }
.rl-cross::before, .rl-cross::after { content: ''; position: absolute; background: #fff; border-radius: 1px; }
.rl-cross::before { left: 8px; top: 0; width: 2px; height: 18px; }
.rl-cross::after { top: 8px; left: 0; height: 2px; width: 18px; }
/* Over something you can hit: the cross turns and opens a little. */
.rl-cross.on { mix-blend-mode: normal; transform: translate(-50%, -50%) rotate(45deg) scale(1.1); transition: transform 120ms ease; }
.rl-cross.on::before, .rl-cross.on::after { background: var(--rl-red); box-shadow: 0 0 0 1px rgba(15, 26, 36, .6); }
.rl-dig { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; transform: translate(-50%, -50%) rotate(-90deg); }
.rl-dig circle { fill: none; stroke: rgba(236, 228, 210, .2); stroke-width: 3; }

/* Life, breath and mana: slim segmented bars with a small icon, over the hotbar. Life is a segment for every 10, mana for every 20. */
/* As wide as the hotbar (9 slots, their gaps and its padding) and sitting on it, so the two read as one unit. */
.rl { --rl-slot: 46px; --rl-barw: calc(9 * var(--rl-slot) + 8 * 4px + 12px); }
.rl-stats { position: absolute; left: 50%; bottom: 76px; width: min(var(--rl-barw), calc(100% - 12px)); transform: translateX(-50%); display: flex; align-items: flex-end; gap: 10px; }
.rl-life, .rl-mana { flex: 1 1 0; display: flex; align-items: center; gap: 7px; min-width: 0; }
.rl-ico { flex: none; width: 18px; height: 18px; display: block; color: #e98a7f; filter: drop-shadow(0 1px 2px rgba(3, 8, 14, .6)); }
.rl-ico.mana { color: #7fc8e6; }
.rl-seg { flex: 1; min-width: 0; display: flex; gap: 3px; padding: 3px; border-radius: 6px; background: var(--rl-glass); border: 1px solid var(--rl-soft); }
.rl-seg i { display: block; flex: 1; min-width: 0; height: 10px; border-radius: 3px; background: linear-gradient(90deg, #e98a7f var(--f), rgba(236, 228, 210, .09) var(--f)); transition: background 150ms ease; }
.rl-seg.mana i { background: linear-gradient(90deg, #7fc8e6 var(--f), rgba(236, 228, 210, .09) var(--f)); }
.rl-seg.low i { animation: rl-pulse 1.2s ease-in-out infinite; }
@keyframes rl-pulse { 50% { opacity: .45; } }
.rl-num { font: 600 11px/1 var(--rl-sans); color: var(--rl-dim); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.rl-shield { min-width: 20px; height: 18px; padding: 0 5px; box-sizing: border-box; display: grid; place-items: center; font: 700 11px/1 var(--rl-sans); color: var(--rl-ink);
  background: var(--rl-glass); border: 1px solid var(--rl-line); border-radius: 5px; }
.rl-air { display: flex; gap: 3px; justify-content: flex-end; }
.rl-side { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: stretch; gap: 5px; }
.rl-air i { width: 8px; height: 8px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, #9bd6ee 55%, #4d93b8); box-shadow: 0 0 0 1px rgba(15, 26, 36, .7); }
/* A red flash round the edge when you're hurt. */
.rl-hurtfx { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(214, 70, 60, .42)); }
.rl-hurtfx.on { animation: rl-hurt 450ms ease-out; }
@keyframes rl-hurt { 0% { opacity: 1; } 100% { opacity: 0; } }

/* The hotbar: rounded slots on a slate strip; the one you hold has a soft glow inside. */
.rl-bar { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 4px; padding: 5px; border-radius: 12px; background: var(--rl-glass); border: 1px solid var(--rl-line); box-shadow: var(--rl-shadow); backdrop-filter: blur(8px); }
.rl-slot { position: relative; width: var(--rl-slot); height: var(--rl-slot); border-radius: 8px; background: rgba(236, 228, 210, .05); border: 1px solid var(--rl-soft); display: grid; place-items: center; transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease; }
.rl-slot canvas { width: 32px; height: 32px; image-rendering: pixelated; }
.rl-slot b { position: absolute; right: 4px; bottom: 2px; font: 700 11px/1.2 var(--rl-sans); font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(3, 8, 14, .95), 0 0 4px rgba(3, 8, 14, .8); }
.rl-bar .rl-slot.on { border-color: var(--rl-brass-hi); background: linear-gradient(rgba(95, 224, 200, .16), rgba(155, 123, 255, .12)); box-shadow: inset 0 0 12px rgba(95, 224, 200, .35), 0 0 10px rgba(123, 157, 255, .25); }
.rl-name { position: absolute; left: 50%; bottom: 100px; transform: translateX(-50%); font: 600 15px var(--rl-serif); letter-spacing: .01em; text-shadow: 0 1px 8px rgba(3, 8, 14, .9); opacity: 0; transition: opacity 150ms ease; }
.rl-name.on { opacity: 1; }

/* Chat, low on the left: lines fade after a while unless it's open. */
.rl-chat { position: absolute; left: 14px; bottom: 80px; width: min(440px, 60vw); }
.rl-chat ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; max-height: 40vh; overflow: hidden; justify-content: flex-end; }
.rl-chat li { padding: 4px 10px; border-radius: 8px; background: rgba(15, 26, 36, .62); font-size: 13.5px; line-height: 1.45; animation: rl-fade 10s forwards; overflow-wrap: anywhere; }
.rl-chat li b { color: var(--rl-brass-hi); font-weight: 600; margin-right: 4px; }
.rl-chat li a { color: inherit; text-decoration: none; pointer-events: auto; }
.rl-chat li.sys { color: var(--rl-dim); }
.rl.chatting .rl-chat li { animation: none; opacity: 1; }
.rl.chatting .rl-chat ol { overflow-y: auto; pointer-events: auto; }
.rl-chat form { margin-top: 6px; pointer-events: auto; }
.rl-chat input { width: 100%; box-sizing: border-box; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--rl-line); background: var(--rl-slate); color: var(--rl-ink); font: 500 14px var(--rl-sans); outline: none; transition: border-color 140ms ease, box-shadow 140ms ease; }
.rl-chat input:focus { border-color: var(--rl-accent); box-shadow: var(--rl-glow); }
@keyframes rl-fade { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }

.rl-debug { position: absolute; left: 10px; top: 10px; margin: 0; padding: 8px 10px; border-radius: 8px; background: rgba(15, 26, 36, .7); border: 1px solid var(--rl-soft); font: 500 12px/1.5 'JetBrains Mono', ui-monospace, Consolas, monospace; color: var(--rl-ink); }
.rl-toast, .rl-view { position: absolute; left: 50%; top: 22%; transform: translate(-50%, 6px); padding: 8px 14px; border-radius: 10px; background: var(--rl-slate); border: 1px solid var(--rl-line); font-weight: 600; font-size: 14px; box-shadow: var(--rl-shadow); opacity: 0; transition: opacity 150ms ease, transform 150ms ease; }
.rl-view { top: 12%; }
.rl-toast.on, .rl-view.on { opacity: 1; transform: translate(-50%, 0); }

/* The boss's bar, the map, and the bag (E). */
.rl-boss { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: min(520px, calc(100% - 32px)); text-align: center; pointer-events: none; }
.rl-boss b { display: block; margin-bottom: 6px; font: 600 16px var(--rl-serif); color: var(--rl-ink); text-shadow: 0 2px 8px rgba(3, 8, 14, .8); letter-spacing: .02em; }
.rl-boss i { display: block; height: 8px; border-radius: 999px; background: var(--rl-slate); border: 1px solid var(--rl-line); overflow: hidden; }
.rl-boss span { display: block; height: 100%; background: linear-gradient(90deg, var(--rl-accent-2), var(--rl-accent)); transform-origin: left; transition: transform 200ms cubic-bezier(.23, 1, .32, 1); }
.rl-boss.rage span { background: linear-gradient(90deg, #b8453c, #e98a5f); }
.rl-map { position: absolute; inset: 0; background: #0b141c; cursor: grab; }
.rl-map:active { cursor: grabbing; }
.rl-map canvas { display: block; width: 100%; height: 100%; }
.rl-map-hint { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); margin: 0; padding: 6px 12px; border-radius: 999px; background: var(--rl-slate); border: 1px solid var(--rl-line); font: 500 12px var(--rl-sans); color: var(--rl-dim); pointer-events: none; white-space: nowrap; }
.rl [hidden] { display: none !important; }
.rl-bag { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(6, 12, 18, .5); animation: rl-fade-in 150ms ease-out; }
.rl-bag-card { display: flex; gap: 20px; max-height: calc(100% - 32px); padding: 18px 20px; border-radius: 10px; background: linear-gradient(var(--rl-slate-2), var(--rl-slate)); border: 1px solid var(--rl-line); box-shadow: var(--rl-shadow); }
.rl-bag-card h3 { margin: 0 0 12px; font: 600 18px var(--rl-serif); letter-spacing: .01em; }
.rl-bag-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rl-defn { color: var(--rl-dim); font-size: 12.5px; font-weight: 500; }
.rl-bag-row { display: flex; gap: 12px; align-items: flex-start; }
.rl-armor { display: grid; gap: 4px; }
.rl-chestbox { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--rl-soft); }
.rl-chestbox .rl-bag-head h3 { margin-bottom: 12px; }
/* A storage hub: each store's slots under its name, scrolling when there are many. */
.rl-chestbox.rl-hub .rl-grid { max-height: 300px; overflow-y: auto; padding-right: 4px; }
.rl-hub-name { grid-column: 1 / -1; margin: 6px 0 2px; font: 600 13px var(--rl-sans); color: var(--rl-brass-hi); }
.rl-hub-name:first-child { margin-top: 0; }
.rl-slot canvas.ghost { opacity: .5; filter: grayscale(1) brightness(1.7); }
/* Crafting: what you can make near the stations you're by. */
.rl-craft { width: 300px; display: flex; flex-direction: column; min-height: 0; padding-left: 20px; border-left: 1px solid var(--rl-soft); }
.rl-craft[hidden] { display: none; }
.rl-craft-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rl-craft-head .rl-pill { padding: 4px 10px; font-size: 12px; }
.rl-near { margin: 0 0 8px; color: var(--rl-dim); font-size: 12.5px; line-height: 1.45; }
.rl-near b { color: var(--rl-ink); font-weight: 600; }
.rl-recipes { flex: 1; min-height: 120px; max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding-right: 4px; scrollbar-width: thin; scrollbar-color: rgba(184, 155, 94, .45) transparent; }
.rl-rec { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--rl-soft); background: rgba(236, 228, 210, .04); color: var(--rl-ink); text-align: left; cursor: pointer; font: inherit; transition: background 140ms ease, border-color 140ms ease, transform 120ms ease; }
.rl-rec:hover { background: rgba(184, 155, 94, .14); border-color: var(--rl-line); transform: translateY(-1px); }
.rl-rec:active { transform: translateY(0) scale(.99); }
.rl-rec.off { opacity: .5; cursor: default; }
.rl-rec.off:hover { background: rgba(236, 228, 210, .04); border-color: var(--rl-soft); transform: none; }
.rl-rec > canvas { width: 32px; height: 32px; flex: none; image-rendering: pixelated; }
.rl-rec-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rl-rec-txt b { font-size: 13px; font-weight: 600; }
.rl-rec-txt em { font-style: normal; font-size: 11px; color: var(--rl-brass-hi); }
.rl-ings { display: flex; flex-wrap: wrap; gap: 6px; }
.rl-ing { display: inline-flex; align-items: center; gap: 2px; font: 600 11px var(--rl-sans); color: var(--rl-dim); }
.rl-ing canvas { width: 16px; height: 16px; image-rendering: pixelated; }
.rl-ing.no { color: var(--rl-red); }
.rl-grid { display: grid; grid-template-columns: repeat(9, var(--rl-slot)); gap: 4px; }
.rl-grid-bar { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--rl-soft); }
.rl-grid .rl-slot { cursor: pointer; }
.rl-grid .rl-slot:hover { background: rgba(184, 155, 94, .16); border-color: var(--rl-line); }
.rl-grid .rl-slot.on { box-shadow: none; border-color: var(--rl-soft); background: rgba(236, 228, 210, .05); }
.rl-slot.lift canvas, .rl-slot.lift b { opacity: .3; }
.rl-fine { margin: 12px 0 0; color: var(--rl-dim); font-size: 12.5px; line-height: 1.5; }
.rl-credit { margin: 8px 0 0; font-size: 11px; opacity: .8; }
.rl-credit a { color: inherit; text-decoration: underline; }
.rl-carry { position: absolute; left: 0; top: 0; pointer-events: none; }
.rl-carry canvas { width: 32px; height: 32px; image-rendering: pixelated; }
/* A tooltip: a small slate card. */
.rl-tip { position: absolute; left: 0; top: 0; pointer-events: none; padding: 7px 11px; border-radius: 8px; background: var(--rl-slate); border: 1px solid var(--rl-line); box-shadow: var(--rl-shadow); font-size: 13px; display: flex; flex-direction: column; gap: 2px; backdrop-filter: blur(6px); }
.rl-tip b { font-weight: 600; }
.rl-tip span { color: var(--rl-dim); }
@keyframes rl-fade-in { from { opacity: 0; } }

/* The cards over the world: loading, paused, signed out, lost, dead. */
.rl-over { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: radial-gradient(ellipse at 50% 38%, rgba(22, 38, 58, .55), rgba(6, 12, 18, .82)); overflow-y: auto; }
.rl-card { width: min(460px, 100%); padding: 28px 28px 24px; border-radius: 10px; background: linear-gradient(var(--rl-slate-2), var(--rl-slate)); border: 1px solid var(--rl-line); box-shadow: var(--rl-shadow); text-align: center; animation: rl-in 150ms ease-out; }
@keyframes rl-in { from { opacity: 0; transform: translateY(6px); } }
.rl-logo { font: 700 32px/1.1 var(--rl-serif); letter-spacing: .01em; color: var(--rl-ink); }
.rl-logo b { font-weight: 700; background: linear-gradient(90deg, var(--rl-brass-hi), var(--rl-brass) 55%, #8fa86a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rl-logo::after { content: ''; display: block; width: 54px; height: 1px; margin: 12px auto 0; background: linear-gradient(90deg, transparent, var(--rl-brass), transparent); }
.rl-card p { color: var(--rl-dim); line-height: 1.6; margin: 12px 0 0; }
.rl-card .rl-sub { color: var(--rl-ink); font: 600 17px var(--rl-serif); }
.rl-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 20px; }
.rl-acts > * { cursor: pointer; }
.rl-load { height: 4px; margin: 20px auto 2px; width: 70%; border-radius: 99px; background: rgba(236, 228, 210, .09); overflow: hidden; }
.rl-load i { display: block; height: 100%; background: linear-gradient(90deg, var(--rl-brass), var(--rl-brass-hi)); transform-origin: left; transform: scaleX(0); transition: transform 200ms ease-out; }
.rl-set { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rl-soft); text-align: left; }
.rl-set h4 { margin: 0 0 8px; font: 600 11.5px var(--rl-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--rl-brass); }
.rl-set label { display: grid; grid-template-columns: 120px 1fr 80px; align-items: center; gap: 10px; font-size: 14px; margin: 6px 0; }
.rl-set label span { color: var(--rl-dim); font-size: 13px; text-align: right; }
.rl-set input[type=range] { accent-color: var(--rl-brass); width: 100%; }
.rl-pills { display: flex; flex-wrap: wrap; gap: 6px; }

/* Buttons: flat, a faint vertical gradient and a brass hairline; they lift and brighten on hover and sink when pressed.
 * The main action (gm-start) is filled brass; the others (gm-ghost, the pills) stay quiet. */
.rl .gm-start, .rl .gm-ghost, .rl-pill, .rl-sign button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 18px; border-radius: 8px; cursor: pointer; text-decoration: none;
  font: 600 14px/1.2 var(--rl-sans); letter-spacing: .01em; color: var(--rl-ink);
  background: linear-gradient(rgba(236, 228, 210, .07), rgba(236, 228, 210, .02)); border: 1px solid var(--rl-line); box-shadow: none;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease, filter 120ms ease, box-shadow 120ms ease;
}
.rl .gm-ghost:hover, .rl-pill:hover:not(:disabled) { transform: translateY(-1px); background: linear-gradient(rgba(236, 228, 210, .13), rgba(236, 228, 210, .05)); border-color: var(--rl-brass-hi); }
.rl .gm-start { color: #1a1408; background: linear-gradient(var(--rl-brass-hi), var(--rl-brass)); border-color: var(--rl-brass-hi); }
.rl .gm-start:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 6px 16px rgba(184, 155, 94, .28); }
.rl .gm-start:active, .rl .gm-ghost:active, .rl-pill:active, .rl-sign button:active { transform: translateY(1px); filter: none; box-shadow: none; }
.rl .gm-start:disabled { opacity: .45; cursor: not-allowed; }
.rl .gm-start:focus-visible, .rl .gm-ghost:focus-visible, .rl-pill:focus-visible, .rl-sign button:focus-visible { outline: none; box-shadow: var(--rl-glow); }
.rl-pill { padding: 6px 12px; font-size: 12.5px; border-radius: 99px; }
.rl-pill.on { color: var(--rl-ink); background: linear-gradient(rgba(95, 224, 200, .18), rgba(155, 123, 255, .14)); border-color: var(--rl-accent); }
.rl-pill:disabled { opacity: .4; cursor: not-allowed; }
.rl-keys { font-size: 12px !important; line-height: 2 !important; }
.rl-keys kbd { padding: 1px 6px; border-radius: 5px; border: 1px solid var(--rl-line); background: rgba(236, 228, 210, .06); font: 600 11px 'JetBrains Mono', ui-monospace, Consolas, monospace; color: var(--rl-ink); }

/* On its own page: a big box; in the End City (hub-play.js): the whole screen. */
.rl-page { height: min(80vh, 780px); min-height: 460px; border-radius: 12px; border: 1px solid var(--rl-line, rgba(184, 155, 94, .6)); }
.rl-page.rl-on { position: fixed; inset: 0; z-index: 80; height: auto; min-height: 0; border-radius: 0; border: 0; }
html:has(.rl-on) { overflow: hidden; }
.hub-realms { position: fixed; inset: 0; z-index: 60; }
.hub-realms .rl { position: absolute; inset: 0; }

@media (max-width: 640px) {
  .rl { --rl-slot: 34px; }
  .rl-slot canvas { width: 24px; height: 24px; }
  .rl-stats { bottom: 64px; }
  .rl-card { padding: 22px 18px 18px; }
  .rl-logo { font-size: 27px; }
  .rl-set label { grid-template-columns: 1fr; }
}
@media (max-width: 900px) { .rl-bag-card { flex-direction: column; overflow-y: auto; } .rl-craft { width: auto; padding-left: 0; border-left: 0; } }
@media (prefers-reduced-motion: reduce) {
  .rl *, .rl *::before, .rl *::after { animation: none !important; transition-duration: 1ms !important; }
}

/* Back from the bag with Escape: the mouse needs a click to be caught again (not the pause menu). */
.rl-resume { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); padding: 8px 16px; border-radius: 999px; background: var(--rl-slate);
  color: var(--rl-ink); font: 600 13px/1 var(--rl-sans); cursor: pointer; pointer-events: auto; border: 1px solid var(--rl-line); }
.rl-resume[hidden], .rl:has(.rl-bag:not([hidden])) .rl-resume, .rl:has(.rl-map:not([hidden])) .rl-resume, .rl:has(.rl-sign) .rl-resume { display: none; }

/* A sign's four lines, and a letter. */
.rl-sign { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 30; display: grid; gap: 6px; width: min(300px, calc(100vw - 32px)); padding: 14px; border-radius: 10px; background: linear-gradient(var(--rl-slate-2), var(--rl-slate)); border: 1px solid var(--rl-line); box-shadow: var(--rl-shadow); color: var(--rl-ink); font: 500 14px/1.3 var(--rl-sans); }
.rl-sign input { font: 600 15px/1.2 var(--rl-sans); text-align: center; padding: 7px 8px; border-radius: 6px; border: 1px solid var(--rl-soft); background: #cdb88f; color: #2a2112; }
.rl-sign input:focus { outline: none; box-shadow: var(--rl-glow); }
.rl-mail label { font-size: 13px; color: var(--rl-dim); }
.rl-mail label b { color: var(--rl-ink); font-weight: 600; }
.rl-mail input { background: rgba(236, 228, 210, .07); color: var(--rl-ink); text-align: left; }
.rl-mail button:disabled, .rl-mail input:disabled { opacity: .5; cursor: default; }
.rl-sign button { margin-top: 4px; }
.rl-sign button.rl-mail-close { background: transparent; }
/* Crafting: search, and what a recipe still needs. */
.rl-search { width: 100%; box-sizing: border-box; margin: 6px 0 2px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--rl-soft); background: rgba(6, 12, 18, .4); color: var(--rl-ink); font: 500 13px/1.2 var(--rl-sans); transition: border-color 140ms ease, box-shadow 140ms ease; }
.rl-search:focus { outline: none; border-color: var(--rl-accent); box-shadow: var(--rl-glow); }
.rl-need { margin: 4px 0 8px; padding: 8px 10px; border-radius: 8px; background: rgba(224, 102, 92, .1); border: 1px solid rgba(224, 102, 92, .3); font-size: 12px; }
.rl-need ul { margin: 4px 0 0; padding-left: 16px; display: grid; gap: 3px; }
.rl-rec.off { cursor: help; }
/* The held gun's rounds, bottom right. */
.rl-ammo { position: absolute; right: 18px; bottom: 18px; color: var(--rl-ink); font: 600 15px var(--rl-sans); text-shadow: 0 2px 8px rgba(3, 8, 14, .8); pointer-events: none; font-variant-numeric: tabular-nums; }
.rl-ammo b { font: 700 30px var(--rl-serif); }
.rl-ammo span { display: block; margin-top: 2px; font-size: 12px; font-weight: 500; opacity: .75; text-align: right; }

.rl-atts { margin-top: 12px; }
.rl-att { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.rl-att-type { width: 64px; flex: none; color: var(--rl-dim); font-size: 13px; }
.rl-att-on, .rl-att-slot { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 4px; border: 1px solid var(--rl-soft); border-radius: 8px; background: rgba(236, 228, 210, .05); color: inherit; font: inherit; font-size: 13px; cursor: pointer; transition: background 140ms ease, border-color 140ms ease; }
.rl-att-slot { padding: 3px; }
.rl-att-on:hover, .rl-att-slot:hover { background: rgba(184, 155, 94, .16); border-color: var(--rl-line); }
.rl-att-on canvas, .rl-att-slot canvas { width: 28px; height: 28px; image-rendering: pixelated; }
.rl-att-fit { display: inline-flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.rl-att-none { margin: 0; }
.rl-scope { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 50%, transparent 0, transparent 31vmin, rgba(4, 8, 12, .96) 31.4vmin); }
.rl-scope::before, .rl-scope::after { content: ''; position: absolute; background: rgba(8, 14, 20, .85); }
.rl-scope::before { left: 50%; top: calc(50% - 31vmin); width: 2px; height: 62vmin; margin-left: -1px; }
.rl-scope::after { top: 50%; left: calc(50% - 31vmin); height: 2px; width: 62vmin; margin-top: -1px; }

.rl-ench-rune { width: 28px; height: 28px; image-rendering: pixelated; flex: none; }
.rl-ench-name { flex: 1; min-width: 90px; font-size: 13px; }
.rl-att-slot.on { border-color: var(--rl-accent); background: linear-gradient(rgba(95, 224, 200, .16), rgba(155, 123, 255, .12)); }
.rl-ench-items { margin-left: 0; }
.rl-ench .rl-pill[disabled] { opacity: .4; cursor: default; }
.rl-tip .rl-ench-line { color: var(--rl-accent); }

.rl-accs { display: flex; gap: 6px; margin-top: 6px; }

.rl-fade { position: absolute; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: #060c12; opacity: 0; pointer-events: none; transition: opacity .45s ease; }
.rl-fade.on { opacity: 1; pointer-events: auto; }
.rl-fade p { margin: 0; color: var(--rl-ink); font: 600 22px var(--rl-serif); letter-spacing: .02em; }

.rl-poisonfx { position: absolute; inset: 0; opacity: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 40%, rgba(110, 190, 80, .4)); transition: opacity .2s linear; }
