/* Lanternwake — page, HUD, menus, dialogs, touch controls.
   Colours: night-blue panels, parchment text, lantern amber for anything alive.
   Layers (bottom to top): #lwCanvas · #lwFloat 4 (numbers, name tags) · #lwTouch 5 · #hud 6 (the menu inside it)
   · #lwUi 8 (dialogs, shops, scenes, notices) · .lw-sheet 30 · #lwLoading 40 · #lwJoin 45 · rankings overlay 60. */
:root {
  --lw-ink: #171a26; --lw-panel: rgba(23, 26, 38, .86); --lw-card: #1b1f2e; --lw-line: rgba(255, 233, 176, .28);
  --lw-text: #fff3d6; --lw-dim: #c9bea0; --lw-amber: #ffb52e; --lw-amber-hi: #ffe08a; --lw-red: #e8483a; --lw-glow: #7fd0ff; --lw-good: #8ff0a0;
  --lw-serif: Georgia, "Palatino Linotype", "Book Antiqua", serif;
  --lw-safe-b: env(safe-area-inset-bottom, 0px); --lw-safe-t: env(safe-area-inset-top, 0px);
  --lw-safe-l: env(safe-area-inset-left, 0px); --lw-safe-r: env(safe-area-inset-right, 0px);
}
html, body.lw { margin: 0; height: 100%; background: #0d0f17; color: var(--lw-text); overflow: hidden; overscroll-behavior: none;
  font: 15px/1.35 "Trebuchet MS", "Segoe UI", system-ui, sans-serif; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
#lwCanvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#lwFloat { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 4; }
#lwUi { position: fixed; inset: 0; pointer-events: none; z-index: 8; }
#lwUi > * { pointer-events: auto; }
[hidden] { display: none !important; }

/* ---- loading screen */
#lwLoading { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 60%, #2a2440 0%, #0d0f17 70%); transition: opacity .5s; }
#lwLoading.gone { opacity: 0; pointer-events: none; }
.lw-load-card { text-align: center; max-width: 86vw; }
.lw-load-card h1, .lw-join-card h1 { margin: 0 0 6px; font: 700 clamp(30px, 7vw, 54px)/1.1 var(--lw-serif); letter-spacing: .04em; color: var(--lw-amber-hi); text-shadow: 0 0 24px rgba(255, 181, 46, .55), 0 2px 0 #7a4a12; }
.lw-load-card p { margin: 0 0 18px; color: var(--lw-dim); }
.lw-load-bar { width: min(320px, 70vw); height: 10px; margin: 0 auto; border-radius: 6px; background: #00000066; border: 1px solid var(--lw-line); overflow: hidden; }
.lw-load-bar i { display: block; height: 100%; width: 10%; background: linear-gradient(90deg, #ff8a1e, #ffe08a); transition: width .25s; }
.lw-load-back { margin-top: 14px !important; }
.lw-flame { width: 34px; height: 46px; margin: 0 auto 10px; background: radial-gradient(ellipse at 50% 70%, #fff6c4 0 22%, #ffb02e 45%, #ff7a1e00 72%); border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%; animation: lw-flicker 1.1s ease-in-out infinite; }
@keyframes lw-flicker { 0%, 100% { transform: scale(1, 1) rotate(-2deg); } 40% { transform: scale(.92, 1.1) rotate(3deg); } 70% { transform: scale(1.06, .94) rotate(-1deg); } }
.lw-back { color: var(--lw-amber-hi); text-decoration: none; font-size: 14px; }
.lw-back:hover { text-decoration: underline; }

/* ---- shared bits */
.lw-btn, .lw-row select, .lw-key { font: inherit; color: var(--lw-text); background: #2b3046; border: 1px solid var(--lw-line); border-radius: 10px; padding: 7px 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; box-sizing: border-box; }
.lw-btn:hover, .lw-key:hover { border-color: var(--lw-amber); }
.lw-btn:disabled { opacity: .45; cursor: default; border-color: var(--lw-line); }
.lw-btn.on { background: var(--lw-amber); color: #2a2010; border-color: var(--lw-amber-hi); }
.lw-btn svg { width: 20px; height: 20px; }
.lw-primary { background: linear-gradient(180deg, #ffc64f, #f59a1c); color: #2a1a06; border-color: #ffe08a; font-weight: 700; font-size: 17px; min-height: 48px; padding: 10px 26px; box-shadow: 0 3px 0 #9a5a0e, 0 8px 22px #ff9a1e44; }
.lw-primary:hover { filter: brightness(1.06); }
.lw-btn-quiet { background: none; border-color: transparent; color: var(--lw-dim); }
.lw-note { color: var(--lw-dim); font-size: 13px; }
.lw-note a { color: var(--lw-amber-hi); }
kbd { font: 700 11px/1 system-ui, sans-serif; color: #2a2010; background: #ffe9b0; border-radius: 5px; padding: 3px 6px; box-shadow: 0 2px 0 #a8741f; white-space: nowrap; }
kbd:empty { display: none; }
.lw-ico svg { width: 20px; height: 20px; display: block; }
svg.lw-ii { display: block; width: 100%; height: 100%; }
/* the site's shared stylesheet pins .volume-slider to the corner of the screen: undo that wherever a strip of ours lives */
.lw-audio .volume-slider, #lwLoading .volume-slider, #lwJoin .volume-slider { position: static; top: auto; right: auto; left: auto; width: auto; }
.lw-audio { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lw-audio-center { justify-content: center; margin-top: 14px; }
.lw-audio .mps-audio { background: #0c0e1699; border-color: var(--lw-line); max-width: 100%; }
.lw-audio .mps-audio-slider { accent-color: var(--lw-amber); }
.lw-audio .mps-audio-btn { color: var(--lw-text); }

/* ---- the title card */
.lw-join { position: fixed; inset: 0; z-index: 45; display: flex; overflow: auto; background: radial-gradient(ellipse at 50% 55%, #2e2748 0%, #141627 55%, #0d0f17 100%); opacity: 0; transition: opacity .4s; padding: calc(8px + var(--lw-safe-t)) 8px calc(8px + var(--lw-safe-b)); box-sizing: border-box; user-select: none; }
.lw-join.on { opacity: 1; }
.lw-join.gone { opacity: 0; pointer-events: none; }
.lw-join-card { width: min(560px, 100%); margin: auto; box-sizing: border-box; padding: 16px 22px 14px; border-radius: 20px; background: linear-gradient(180deg, #20243a, #181b2b); border: 1px solid var(--lw-line); box-shadow: 0 24px 80px #000b, inset 0 1px 0 #ffffff14; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.lw-join-head .lw-flame { margin-bottom: 2px; width: 28px; height: 38px; }
.lw-join-card h1 { font-size: clamp(30px, 6vw, 46px); }
/* a laptop is 650-720 px tall: with the creation open the story line makes room */
@media (max-height: 840px) { .lw-join.creating .lw-tagline { display: none; } }
@media (max-height: 700px) { .lw-join-card { gap: 6px; padding-top: 10px; padding-bottom: 10px; } .lw-join-card h1 { font-size: clamp(28px, 5vw, 36px); } .lw-join-head .lw-flame { display: none; } .lw-join .lw-audio-center { margin-top: 0; } }
.lw-tagline { margin: 4px auto 0; max-width: 44ch; color: var(--lw-dim); font: italic 15px/1.45 var(--lw-serif); }
.lw-join-name { width: min(320px, 100%); display: flex; flex-direction: column; gap: 4px; }
.lw-join-name label, .lw-create h2, .lw-pk > span { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--lw-amber); margin: 0; font-weight: 700; }
#nameInput { font: 600 18px/1.2 inherit; color: var(--lw-text); background: #0c0e16; border: 1px solid var(--lw-line); border-radius: 12px; padding: 11px 14px; text-align: center; outline: none; user-select: text; -webkit-user-select: text; }
#nameInput:focus { border-color: var(--lw-amber); box-shadow: 0 0 0 3px #ffb52e33; }
#nameInput::placeholder { color: #8a8470; font-weight: 400; }
/* the shared "Playing as X" chip (web/shared/account.js), in our colours and without its glyph */
.lw-join .account-playing-as { font-size: 0; margin: 0 auto; padding: 10px 16px; max-width: none; border-radius: 12px; background: #ffb52e1f; border: 1px solid #ffb52e66; color: var(--lw-text); gap: 0; }
.lw-join .account-playing-as::before { content: "Playing as"; font-size: 14px; font-weight: 400; color: var(--lw-dim); margin-right: 7px; }
.lw-join .account-playing-as-name { font-size: 18px; font-weight: 700; }
.lw-create { width: 100%; }
.lw-create h2 { margin-bottom: 6px; }
.lw-picker { display: grid; grid-template-columns: 150px 1fr; gap: 6px 16px; align-items: center; text-align: left; }
.lw-picker-view { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.lw-chibi { width: 138px; height: auto; display: block; filter: drop-shadow(0 6px 10px #0008); }
.lw-chibi .f { display: none; } .lw-chibi.is-f .f { display: inline; } .lw-chibi.is-f .m { display: none; }
.lw-chibi .hp { display: none; } .lw-chibi.pony .hp { display: inline; } .lw-chibi.pony .ht { display: none; }
.lw-chibi.pop { animation: lw-pop .28s ease-out; }
@keyframes lw-pop { 0% { transform: scale(.94, 1.06); } 60% { transform: scale(1.04, .97); } 100% { transform: none; } }
.lw-dice { font-size: 13px; min-height: 30px; padding: 3px 10px; text-decoration: underline; text-underline-offset: 3px; }
.lw-picker-rows { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lw-pk { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 8px; }
.lw-pk-pair { display: flex; flex-direction: column; gap: 8px; }
/* the items page on a wide screen: the grid on the left, what you picked beside it (never over the grid) */
@media (min-width: 721px) {
  .lw-tab[data-page="items"]:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 0 14px; align-items: start; }
  .lw-tab[data-page="items"] .lw-equip { grid-column: 1 / -1; }
  .lw-tab[data-page="items"] .lw-item-detail { position: sticky; top: 64px; bottom: auto; box-shadow: none; flex-direction: column; margin-top: 10px; }
}
.lw-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.lw-seg button { font: inherit; color: var(--lw-text); background: #2b3046; border: 2px solid transparent; border-radius: 10px; min-height: 40px; cursor: pointer; }
.lw-seg button.on { border-color: var(--lw-amber); background: #3a3320; color: var(--lw-amber-hi); font-weight: 700; }
.lw-sw-row { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 5px; }
.lw-sw { height: 40px; border-radius: 10px; background: var(--c); border: 2px solid #0006; padding: 0; cursor: pointer; box-shadow: inset 0 -6px 0 #0002, inset 0 2px 0 #fff3; }
.lw-sw.on { border-color: #fff; box-shadow: 0 0 0 3px var(--lw-amber), inset 0 -6px 0 #0002; transform: translateY(-2px); }
#lwPlay { width: min(320px, 100%); margin-top: 4px; }
.lw-join-note { margin: -2px 0 0; min-height: 0; }
.lw-join-note:empty { display: none; }
.lw-join-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: flex-start; width: 100%; }
.lw-join-help { position: relative; }
.lw-join-help summary { list-style: none; } .lw-join-help summary::-webkit-details-marker { display: none; }
.lw-join-help[open] { flex-basis: 100%; }
.lw-join-help-rows { margin: 8px auto 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; text-align: left; max-width: 420px; }
.lw-join-help-rows div { display: flex; align-items: center; gap: 8px; color: var(--lw-dim); font-size: 14px; }
.lw-join .lw-audio-center { margin-top: 2px; }

/* ---- HUD */
.lw-hud { position: fixed; inset: 0; z-index: 6; pointer-events: none; }
.lw-hud button, .lw-hud select, .lw-hud .lw-panel { pointer-events: auto; }
.lw-tl { position: absolute; left: calc(12px + var(--lw-safe-l)); top: calc(10px + var(--lw-safe-t)); max-width: min(46vw, 330px); }
.lw-candles { display: flex; flex-wrap: wrap; gap: 1px; max-width: min(46vw, 300px); filter: drop-shadow(0 2px 2px #0008); }
.lw-candle svg { width: 22px; height: 32px; display: block; }
.lw-candles.low .lw-candle-1 svg, .lw-candles.low .lw-candle-2 svg { animation: lw-low .7s ease-in-out infinite; }
@keyframes lw-low { 50% { transform: translateY(-2px) scale(1.08); } }
.lw-glow { width: 132px; height: 9px; margin-top: 5px; border-radius: 6px; background: #0009; border: 1px solid #ffffff33; overflow: hidden; }
.lw-glow-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #3f9ad9, #bfeaff); box-shadow: 0 0 8px #7fd0ff; transition: width .2s; }
.lw-glow.no { animation: lw-no .35s; border-color: var(--lw-red); }
.lw-jars { display: flex; gap: 3px; margin-top: 4px; } .lw-jars:empty { display: none; }
.lw-jar { width: 22px; height: 22px; display: block; opacity: .62; filter: drop-shadow(0 1px 1px #0009); } .lw-jar.full { opacity: 1; }
.lw-slot-item.noammo .lw-slot-ico { opacity: .4; } .lw-slot-item.noammo .lw-ammo { color: #ff8c7c; }
/* the Wayfinder Chime: its list, and the bar while it rings */
.lw-chime-sheet .lw-ways { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; }
.lw-chime-sheet .lw-way .lw-btn { min-height: 44px; }
.lw-ringing { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); width: min(300px, 80vw); padding: 10px 14px; border-radius: 14px; background: var(--lw-panel); border: 1px solid #7fd0ff88; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none !important; }
.lw-ringing .lw-ico svg { width: 30px; height: 30px; } .lw-ringing .lw-down-bar i { background: linear-gradient(90deg, #3f9ad9, #bfeaff); }
.lw-objective { margin-top: 9px; padding: 6px 10px 6px 12px; border-radius: 4px 12px 12px 4px; background: var(--lw-panel); border-left: 3px solid var(--lw-amber); font-size: 14px; line-height: 1.3; text-shadow: 0 1px 0 #000a; display: flex; gap: 8px; align-items: baseline; }
.lw-objective.new { animation: lw-obj 1s ease-out; }
@keyframes lw-obj { 0% { background: #ffb52ecc; color: #2a1a06; transform: translateX(-6px); } 100% { transform: none; } }
.lw-obj-n, .lw-step-n { color: var(--lw-amber-hi); white-space: nowrap; font-weight: 700; }
.lw-obj-n:empty, .lw-step-n:empty { display: none; }
.lw-tr { position: absolute; right: calc(12px + var(--lw-safe-r)); top: calc(10px + var(--lw-safe-t)); display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.lw-coins { display: flex; gap: 6px; align-items: center; }      /* keys beside the purse: one row, so a dungeon does not push the map down */
.lw-purse, .lw-keys { display: flex; align-items: center; gap: 5px; padding: 3px 10px 3px 6px; border-radius: 16px; background: var(--lw-panel); border: 1px solid var(--lw-line); font-size: 16px; }
.lw-purse.bump b { animation: lw-bump .3s ease-out; display: inline-block; }
@keyframes lw-bump { 40% { transform: scale(1.35); color: var(--lw-amber-hi); } }
.lw-purse.no { animation: lw-no .35s; border-color: var(--lw-red); }
@keyframes lw-no { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.lw-minibtn { position: relative; padding: 0; border: 1px solid var(--lw-line); border-radius: 10px; background: #0b0d14cc; cursor: pointer; overflow: hidden; display: block; line-height: 0; }
.lw-minibtn:hover { border-color: var(--lw-amber); }
.lw-minimap { width: 132px; height: 110px; display: block; }
.lw-zone-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 9px 4px 3px; font: 11px/1.1 "Trebuchet MS", system-ui, sans-serif; color: var(--lw-text); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: linear-gradient(180deg, #0b0d1400, #0b0d14e6 55%); }
.lw-zone-name:empty { display: none; }
.lw-menubtns { display: flex; gap: 6px; }
.lw-mb { position: relative; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--lw-line); background: var(--lw-panel); padding: 8px; cursor: pointer; color: var(--lw-text); }
.lw-mb:hover { border-color: var(--lw-amber); }
.lw-mb svg { width: 100%; height: 100%; display: block; }
.lw-mb kbd { position: absolute; right: -4px; bottom: -5px; }
.lw-toast { position: absolute; left: 50%; top: 15%; transform: translate(-50%, -8px); padding: 6px 26px; border-radius: 22px; text-align: center;
  color: var(--lw-amber-hi); background: linear-gradient(90deg, #171a2600, #171a26d9 18% 82%, #171a2600); text-shadow: 0 2px 0 #000a; opacity: 0; transition: opacity .5s, transform .5s; white-space: nowrap; }
.lw-toast span { display: block; font: clamp(19px, 3.4vw, 27px)/1.2 var(--lw-serif); letter-spacing: .06em; }
.lw-toast small { display: block; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--lw-dim); }
.lw-toast small:empty { display: none; }
.lw-toast.on { opacity: 1; transform: translate(-50%, 0); }
.lw-notes { position: absolute; left: 50%; top: calc(15% + 62px); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 5px; width: min(92vw, 520px); }
.lw-note-line { padding: 5px 14px; border-radius: 14px; background: var(--lw-panel); border: 1px solid var(--lw-line); font-size: 14px; text-align: center; text-shadow: 0 1px 0 #000a; animation: lw-note-in .25s ease-out; transition: opacity .3s, transform .3s; max-width: 100%; box-sizing: border-box; }
.lw-note-line.out { opacity: 0; transform: translateY(-6px); }
.lw-note-warn { border-color: #e8483a99; color: #ffd2c8; } .lw-note-good { border-color: #8ff0a099; color: #dfffe4; }
@keyframes lw-note-in { from { opacity: 0; transform: translateY(8px); } }
.lw-boss { position: absolute; left: 50%; bottom: calc(92px + var(--lw-safe-b)); transform: translateX(-50%); width: min(520px, 76vw); text-align: center; opacity: 0; transition: opacity .3s; }
.lw-boss.on { opacity: 1; }
.lw-boss span { display: inline-block; font: 16px/1.2 var(--lw-serif); letter-spacing: .08em; text-shadow: 0 2px 0 #000; margin-bottom: 4px; padding: 2px 16px; border-radius: 12px; background: #10121cb8; }
.lw-boss div { height: 12px; border-radius: 7px; background: #000a; border: 1px solid #ffffff44; overflow: hidden; }
.lw-boss i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #8a2f6a, #e8483a); transition: width .25s; }
.lw-prompt { position: absolute; left: 50%; bottom: calc(150px + var(--lw-safe-b)); transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 18px;
  background: var(--lw-panel); border: 1px solid var(--lw-line); opacity: 0; transition: opacity .15s; }
.lw-prompt.on { opacity: 1; }
.lw-slots { position: absolute; left: 50%; bottom: calc(14px + var(--lw-safe-b)); transform: translateX(-50%); display: flex; gap: 8px; align-items: flex-end; }
.lw-slot { position: relative; width: 46px; height: 46px; border-radius: 12px; background: var(--lw-panel); border: 1px solid var(--lw-line); display: grid; place-items: center; }
.lw-slot svg { width: 28px; height: 28px; }
.lw-slot kbd { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); }
.lw-slot-item { width: 54px; height: 54px; border-color: #ffb52e88; margin-left: 4px; }
.lw-slot-item.empty { opacity: .55; border-style: dashed; }
.lw-slot-ico { width: 38px; height: 38px; display: block; }
.lw-slot .lw-slot-ico svg { width: 100%; height: 100%; }
.lw-ammo { position: absolute; right: 3px; top: 1px; font-size: 12px; text-shadow: 0 1px 0 #000, 0 0 4px #000; }
.lw-floater { position: absolute; left: 0; top: 0; font: 800 22px/1 "Trebuchet MS", system-ui, sans-serif; color: #fff; text-shadow: 0 2px 0 #000, 0 0 6px #000; will-change: transform; white-space: nowrap; }
.lw-floater-dmg { color: #ffe08a; } .lw-floater-hurt { color: #ff6a5a; } .lw-floater-heal { color: #8ff0a0; } .lw-floater-glint { color: #ffd76a; font-size: 17px; } .lw-floater-big { font-size: 30px; color: #fff; }

/* ---- name tags and chat bubbles (world-anchored, in #lwFloat) */
.lw-tag { position: absolute; left: 0; top: 0; translate: -50% -100%; display: flex; flex-direction: column; align-items: center; gap: 2px; will-change: transform; pointer-events: none; }
.lw-tag-plate { padding: 1px 8px 2px; border-radius: 9px; background: #10121cb8; text-align: center; white-space: nowrap; line-height: 1.15; max-width: 240px; }
.lw-tag-name { font: 700 13px/1.2 "Trebuchet MS", system-ui, sans-serif; color: var(--lw-text); }
.lw-tag .mg-name-title { font-size: 10.5px; color: var(--lw-dim); opacity: .95; text-shadow: 0 1px 0 #000; }
.lw-tag.me .lw-tag-plate { background: #10121c85; }
.lw-tag.ghost { opacity: .5; }
.lw-tag-state { font: 700 10.5px/1.2 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 8px; background: #2b3046e6; color: var(--lw-dim); position: relative; overflow: hidden; white-space: nowrap; }
.lw-tag.down .lw-tag-state { background: #7a1f1ae6; color: #ffd2c8; }
.lw-tag-state i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--lw-good); }
.lw-bubble { max-width: 220px; padding: 5px 10px; border-radius: 12px 12px 12px 3px; background: #fff3d6; color: #2a2010; font: 13px/1.3 "Trebuchet MS", system-ui, sans-serif; box-shadow: 0 3px 10px #0008; overflow-wrap: anywhere; text-align: left; margin-bottom: 2px; }
.lw-bubble.in { animation: lw-note-in .2s ease-out; }

/* a gilded name is transparent text over a moving gradient: any text-shadow of ours would show through it as dark letters */
body.lw .mg-fx-gilded { text-shadow: none; }

/* ---- chat: the log lives in the HUD (bottom left), the bar above everything */
.lw-chatlog { position: absolute; left: calc(12px + var(--lw-safe-l)); bottom: calc(18px + var(--lw-safe-b)); width: min(340px, 34vw); max-height: 132px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; font-size: 13.5px; pointer-events: none; }
.lw-chat-line { padding: 2px 8px; border-radius: 8px; background: #10121cbf; text-shadow: 0 1px 0 #000a; overflow-wrap: anywhere; transition: opacity .6s; align-self: flex-start; max-width: 100%; box-sizing: border-box; flex: none; }
.lw-chat-line.old { opacity: 0; }
.lw-chatlog.open { max-height: 40vh; overflow-y: auto; pointer-events: auto; justify-content: flex-start; user-select: text; -webkit-user-select: text; }
.lw-chatlog.open .lw-chat-line.old { opacity: .8; }
.lw-chat-name { font-weight: 700; margin-right: 6px; text-shadow: none; }
.lw-chat-line.sys { color: var(--lw-dim); font-style: italic; } .lw-chat-line.sys .lw-chat-name { font-style: normal; }
.lw-chatbar { position: absolute; left: calc(12px + var(--lw-safe-l)); bottom: calc(160px + var(--lw-safe-b)); width: min(460px, calc(100vw - 24px)); margin: 0; padding: 10px; border-radius: 14px; background: var(--lw-card); border: 1px solid var(--lw-line); box-shadow: 0 12px 40px #000a; box-sizing: border-box; }
.lw-who { margin-bottom: 8px; }
.lw-who-n { display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--lw-amber); margin-bottom: 5px; }
.lw-who-list { display: flex; flex-wrap: wrap; gap: 4px 6px; max-height: 84px; overflow: auto; }
.lw-who-chip { padding: 2px 9px; border-radius: 10px; background: #2b3046; font-size: 13px; font-weight: 700; white-space: nowrap; }
.lw-who-chip small { font-weight: 400; color: var(--lw-dim); margin-left: 6px; }
.lw-chat-row { display: flex; gap: 6px; }
.lw-chat-in { flex: 1; min-width: 0; font: inherit; font-size: 16px; color: var(--lw-text); background: #0c0e16; border: 1px solid var(--lw-line); border-radius: 10px; padding: 8px 12px; outline: none; user-select: text; -webkit-user-select: text; }
.lw-chat-in:focus { border-color: var(--lw-amber); }
.lw-chat-btn { width: 42px; min-height: 42px; padding: 0; flex: none; }

/* ---- the menu */
.lw-panel { position: absolute; inset: 0; background: #0a0c14b3; display: grid; place-items: center; z-index: 20; }
.lw-panel-card { width: min(680px, 94vw); height: min(86vh, 640px); max-height: calc(100dvh - 16px - var(--lw-safe-t) - var(--lw-safe-b)); overflow: auto; background: var(--lw-card); border: 1px solid var(--lw-line); border-radius: 16px; padding: 0 16px 16px; box-shadow: 0 18px 60px #000c; user-select: text; -webkit-user-select: text; box-sizing: border-box; overscroll-behavior: contain; }
.lw-tabs { display: flex; gap: 2px; align-items: center; position: sticky; top: 0; z-index: 2; background: var(--lw-card); margin: 0 -16px 8px; padding: 10px 12px 8px; border-bottom: 1px solid #ffffff14; }
.lw-tabs button { background: none; border: 0; color: var(--lw-dim); font: inherit; font-size: 14px; padding: 7px 9px; border-radius: 10px; cursor: pointer; display: flex; align-items: center; gap: 5px; min-height: 40px; }
.lw-tabs button svg { width: 20px; height: 20px; flex: none; }
.lw-tabs button.on { color: #2a2010; background: var(--lw-amber); font-weight: 700; }
.lw-tabs button.on svg path[stroke="#fff3d6"], .lw-tabs button.on svg circle[stroke="#fff3d6"] { stroke: #2a2010; }
.lw-tabs .lw-x { margin-left: auto; color: var(--lw-text); width: 40px; justify-content: center; padding: 0; }
.lw-tab h3, .lw-item-grid h3 { margin: 14px 0 6px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--lw-amber); }
.lw-tab > h3:first-child { margin-top: 6px; }
.lw-tab p { margin: 0 0 6px; }
.lw-goal { font: 17px/1.45 var(--lw-serif); }
.lw-step { display: flex; gap: 8px; align-items: baseline; padding: 7px 12px; border-left: 3px solid var(--lw-amber); background: #ffb52e14; border-radius: 3px 10px 10px 3px; margin-top: 6px; }
.lw-quests { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lw-quests li { display: flex; gap: 8px; align-items: flex-start; }
.lw-quests li i { flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--lw-amber); box-sizing: border-box; color: #2a2010; display: grid; place-items: center; }
.lw-quests li.done i { background: var(--lw-good); border-color: var(--lw-good); } .lw-quests li i svg { width: 12px; height: 12px; }
.lw-quests li.done { color: var(--lw-dim); }
.lw-quests b { display: block; } .lw-quests span { color: var(--lw-dim); font-size: 14px; }
.lw-collect { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.lw-stat { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 12px; background: #242941; }
.lw-stat-ico { width: 30px; height: 30px; flex: none; display: grid; place-items: center; } .lw-stat-ico svg { max-width: 100%; max-height: 100%; }
.lw-stat b { display: block; font-size: 17px; } .lw-stat span { color: var(--lw-dim); font-size: 12.5px; line-height: 1.2; display: block; }
.lw-return-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; padding-top: 12px; border-top: 1px solid #ffffff14; }
.lw-return.armed { background: var(--lw-amber); color: #2a2010; border-color: var(--lw-amber-hi); font-weight: 700; }
.lw-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; }
.lw-me-name { font-weight: 700; font-size: 16px; }
.lw-binds { width: 100%; border-collapse: collapse; font-size: 14px; }
.lw-binds th { text-align: left; color: var(--lw-dim); font-weight: 400; padding: 2px 6px; }
.lw-binds td { padding: 3px 6px; border-top: 1px solid #ffffff14; }
.lw-key { padding: 3px 10px; min-width: 64px; min-height: 30px; }
/* items */
.lw-equip { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.lw-eq { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; background: #242941; border: 1px solid #ffb52e66; color: var(--lw-text); font: inherit; text-align: left; cursor: pointer; min-height: 56px; }
.lw-eq.empty { border-style: dashed; border-color: var(--lw-line); cursor: default; }
.lw-eq-ico { width: 40px; height: 40px; flex: none; }
.lw-eq-text b { display: inline-block; font: 700 11px/1 system-ui, sans-serif; color: #2a2010; background: #ffe9b0; border-radius: 5px; padding: 3px 6px; box-shadow: 0 2px 0 #a8741f; }
.lw-eq-text span { display: block; margin-top: 3px; } .lw-eq.empty .lw-eq-text span { color: var(--lw-dim); }
.lw-item-grid { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lw-item-grid h3 { flex-basis: 100%; margin: 10px 0 0; }
.lw-item { position: relative; width: 58px; height: 58px; padding: 8px; border-radius: 12px; background: #242941; border: 2px solid transparent; cursor: pointer; }
.lw-item.on { border-color: var(--lw-amber); background: #3a3320; }
.lw-item-n { position: absolute; right: 4px; bottom: 2px; font-size: 13px; color: var(--lw-text); text-shadow: 0 1px 0 #000, 0 0 4px #000; }
.lw-item-on { position: absolute; left: -4px; top: -5px; font: 700 11px/1 system-ui, sans-serif; color: #2a2010; background: #ffe9b0; border-radius: 5px; padding: 3px 5px; box-shadow: 0 2px 0 #a8741f; font-style: normal; }
.lw-item-detail { display: flex; gap: 14px; margin-top: 14px; padding: 12px; border-radius: 14px; background: #141726; border: 1px solid #ffffff24; min-height: 96px; position: sticky; bottom: 0; box-shadow: 0 -10px 18px 4px var(--lw-card); }
.lw-item-big { width: 72px; height: 72px; flex: none; }
.lw-item-text b { font: 700 19px/1.2 var(--lw-serif); color: var(--lw-amber-hi); }
.lw-item-text p { margin: 4px 0 0; }
.lw-item-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; } .lw-item-btns:empty { display: none; }
.lw-item-btns .lw-btn { min-height: 42px; }
/* world map */
.lw-map-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 6px 0 8px; }
.lw-map-title { font: 700 20px/1.2 var(--lw-serif); color: var(--lw-amber-hi); }
.lw-bigmap { width: 100%; height: auto; display: block; border-radius: 12px; background: radial-gradient(ellipse at 50% 50%, #1a1e30, #0b0d14); border: 1px solid #ffffff14; }
.lw-map-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 12.5px; color: var(--lw-dim); }
.lw-map-legend span { display: inline-flex; align-items: center; gap: 5px; } .lw-map-legend i { width: 11px; height: 11px; border-radius: 3px; border: 1px solid #0008; display: inline-block; }
.lw-ways { display: flex; flex-direction: column; gap: 6px; }
.lw-way { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 12px; background: #242941; }
.lw-way-ico { width: 22px; height: 22px; color: var(--lw-glow); flex: none; } .lw-way-ico svg { width: 100%; height: 100%; }
.lw-way .lw-btn { margin-left: auto; } .lw-way.here { outline: 1px solid #7fd0ff66; }
/* help */
.lw-help-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 16px; }
.lw-help-row { display: flex; align-items: center; gap: 10px; min-height: 28px; }
.lw-help-row kbd { flex: none; min-width: 34px; text-align: center; box-sizing: border-box; font-size: 12px; padding: 4px 7px; }
.lw-help-tips { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; color: var(--lw-text); }
.lw-help-tips li::marker { color: var(--lw-amber); }
/* the hall of fame (web/shared/rankings.js draws it; these are only its colours) */
.lw-fame, .lb-overlay { --lb-accent: #ffb52e; --lb-text: #fff3d6; --lb-dim: #c9bea0; --lb-edge: rgba(255, 233, 176, .28); --lb-panel: #242941; }
.lw-fame .lb-panel { margin-top: 6px; background: none; border: 0; padding: 0; }
.lw-fame .lb-title, .lb-overlay .lb-title { font: 700 20px/1.2 var(--lw-serif); color: var(--lw-amber-hi); margin: 0 0 8px; }
.lw-fame .lb-pill, .lb-overlay .lb-pill { font-size: 13.5px; padding: 8px 13px; }
.lw-fame .lb-row { padding: 5px 0; }
body.lw .lb-card { background: #1b1f2e; color: var(--lw-text); }

/* ---- dialogs, signs, item cards */
.lw-dlg { position: absolute; left: 50%; bottom: calc(22px + var(--lw-safe-b)); transform: translateX(-50%); width: min(760px, calc(100vw - 20px - var(--lw-safe-l) - var(--lw-safe-r))); }
.lw-dlg-box { position: relative; display: flex; gap: 14px; padding: 20px 22px 18px; border-radius: 18px; background: linear-gradient(180deg, #232842f5, #171a28f7); border: 2px solid #ffb52ea6; box-shadow: 0 14px 50px #000c, inset 0 1px 0 #ffffff1a; cursor: pointer; animation: lw-dlg-in .18s ease-out; }
@keyframes lw-dlg-in { from { opacity: 0; transform: translateY(12px); } }
.lw-dlg-main { flex: 1; min-width: 0; }
.lw-dlg-who { position: absolute; left: 18px; top: -15px; padding: 3px 14px 4px; border-radius: 10px; background: var(--lw-amber); color: #2a1a06; font: 700 15px/1.2 var(--lw-serif); box-shadow: 0 3px 0 #9a5a0e; white-space: nowrap; max-width: calc(100% - 60px); overflow: hidden; text-overflow: ellipsis; }
.lw-dlg-who:empty { display: none; }
.lw-dlg-text { margin: 2px 0 0; font: 19px/1.5 var(--lw-serif); min-height: 2.9em; overflow-wrap: break-word; }
.lw-dlg-text .off, .lw-scene-text .off { visibility: hidden; }
.lw-dlg-icon { width: 64px; height: 64px; flex: none; align-self: center; filter: drop-shadow(0 4px 6px #0008); }
.lw-dlg-icon:empty { display: none; }
.lw-dlg-choices { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.lw-choice { justify-content: flex-start; text-align: left; min-height: 46px; font-size: 17px; padding: 8px 16px; }
.lw-choice.on { background: #3a3320; color: var(--lw-amber-hi); border-color: var(--lw-amber); }
.lw-choice.on::before { content: ""; width: 0; height: 0; border: 6px solid transparent; border-left: 9px solid var(--lw-amber); margin-right: 2px; }
.lw-dlg-more { position: absolute; right: 14px; bottom: 8px; display: flex; align-items: center; gap: 7px; opacity: 0; transition: opacity .15s; }
.lw-dlg-more.on { opacity: 1; }
.lw-dlg-more i { width: 0; height: 0; border: 6px solid transparent; border-top: 8px solid var(--lw-amber); margin-top: 6px; animation: lw-more .7s ease-in-out infinite; }
@keyframes lw-more { 50% { transform: translateY(4px); } }
/* a sign: a board, not a voice */
.lw-dlg-box.sign { background: linear-gradient(180deg, #8a5c36f7, #6a4326f7); border-color: #3d2412; box-shadow: 0 14px 50px #000c, inset 0 0 0 3px #a8743f, inset 0 3px 0 4px #ffffff14; }
.lw-dlg-box.sign .lw-dlg-text { text-align: center; color: #fff3d6; text-shadow: 0 2px 0 #3d2412; }
/* "You got…" */
.lw-dlg-box.get { border-color: var(--lw-amber-hi); box-shadow: 0 14px 50px #000c, 0 0 0 4px #ffb52e33, 0 0 40px #ffb52e55; }
.lw-dlg-box.get .lw-dlg-who { position: static; display: inline-block; background: none; box-shadow: none; color: var(--lw-amber-hi); padding: 0; font-size: 21px; white-space: normal; max-width: none; }
.lw-dlg-box.get .lw-dlg-text { font-size: 17px; min-height: 0; color: var(--lw-text); }
.lw-get { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; pointer-events: none !important; width: min(400px, 62vw); margin-top: 8px; }
.lw-get:empty { display: none; }
.lw-get-banner { display: flex; align-items: center; gap: 10px; padding: 7px 16px 7px 9px; border-radius: 16px; background: var(--lw-panel); border: 1px solid #ffb52e99; box-shadow: 0 6px 22px #0009; animation: lw-note-in .25s ease-out; transition: opacity .4s, transform .4s; max-width: 100%; box-sizing: border-box; }
.lw-get-banner.out { opacity: 0; transform: translateY(-8px); }
.lw-get-ico { width: 40px; height: 40px; flex: none; }
.lw-get-banner b { display: block; color: var(--lw-amber-hi); } .lw-get-banner span { display: block; font-size: 13px; color: var(--lw-dim); line-height: 1.25; }

/* ---- shops */
.lw-shop, .lw-notice { position: absolute; inset: 0; display: grid; place-items: center; background: #0a0c1499; padding: calc(8px + var(--lw-safe-t)) 8px calc(8px + var(--lw-safe-b)); box-sizing: border-box; }
.lw-shop-card { width: min(580px, 100%); max-height: 100%; overflow: auto; box-sizing: border-box; padding: 16px 16px 14px; border-radius: 18px; background: var(--lw-card); border: 2px solid #ffb52ea6; box-shadow: 0 18px 60px #000c; animation: lw-dlg-in .18s ease-out; }
.lw-shop-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.lw-shop-head h2 { margin: 0; flex: 1; font: 700 22px/1.2 var(--lw-serif); color: var(--lw-amber-hi); }
.lw-shop-purse { display: flex; align-items: center; gap: 5px; padding: 4px 12px 4px 7px; border-radius: 16px; background: #0c0e16; border: 1px solid var(--lw-line); font-size: 17px; }
.lw-shop-rows { display: flex; flex-direction: column; gap: 8px; }
.lw-shop-row { display: grid; grid-template-columns: 48px 1fr auto auto; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 14px; background: #242941; border: 2px solid transparent; }
.lw-shop-row.on { border-color: #ffb52e88; }
.lw-shop-ico { width: 48px; height: 48px; }
.lw-shop-what b { display: block; font-size: 16px; } .lw-shop-what b i { color: var(--lw-dim); font-weight: 400; font-style: normal; }
.lw-shop-what span { display: block; font-size: 13px; color: var(--lw-dim); line-height: 1.25; } .lw-shop-what span.why { color: #ffb1a4; }
.lw-shop-price { display: flex; align-items: center; gap: 4px; font-size: 18px; font-weight: 700; color: var(--lw-amber-hi); }
.lw-shop-row.no .lw-shop-price { color: #ff9c8c; } .lw-shop-row.no .lw-shop-ico { opacity: .55; }
.lw-buy { min-width: 70px; min-height: 44px; font-weight: 700; }
.lw-shop-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.lw-shop-hint { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.lw-shop-msg { flex: 1; color: #ffb1a4; } .lw-shop-msg.flash { animation: lw-no .35s; }
.lw-shop-leave { min-height: 44px; }

/* ---- mini-games: a card like a dialog while the hero is held, a small counter at the top while he is free */
.lw-mg { position: absolute; left: 50%; bottom: calc(22px + var(--lw-safe-b)); transform: translateX(-50%); width: min(520px, calc(100vw - 20px)); }
.lw-mg-card { padding: 16px 18px 12px; border-radius: 18px; background: linear-gradient(180deg, #232842f5, #171a28f7); border: 2px solid #ffb52ea6; box-shadow: 0 14px 50px #000c; text-align: center; animation: lw-dlg-in .18s ease-out; }
.lw-mg-title { display: block; font: 700 22px/1.2 var(--lw-serif); color: var(--lw-amber-hi); }
.lw-mg-text { margin: 4px 0 0; font-size: 16px; } .lw-mg-text:empty { display: none; }
.lw-mg-opts { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; } .lw-mg-opts:empty { display: none; }
.lw-mg-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; min-height: 36px; }
.lw-mg.now .lw-mg-card { border-color: #fff; background: linear-gradient(180deg, #ffc64f, #f59a1c); animation: lw-pop .25s ease-out; }
.lw-mg.now .lw-mg-title { color: #2a1a06; font-size: 34px; } .lw-mg.now .lw-mg-note { color: #2a1a06; font-weight: 700; }
.lw-mg.free { bottom: auto; top: calc(10px + var(--lw-safe-t)); width: auto; max-width: min(320px, calc(100vw - 300px)); }
.lw-mg.free .lw-mg-card { padding: 6px 12px; border-radius: 14px; border-width: 1px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.lw-mg.free .lw-mg-title { font-size: 16px; } .lw-mg.free .lw-mg-text { margin: 0; font-size: 14px; } .lw-mg.free .lw-mg-foot { margin: 0; min-height: 0; }
.lw-mg.free .lw-mg-quit { min-height: 30px; padding: 2px 8px; }

/* ---- scenes: text over a dimmed game, between two bars */
.lw-scene { position: absolute; inset: 0; display: flex; flex-direction: column; background: #080910e0; cursor: pointer; animation: lw-fade .5s ease-out; transition: opacity .5s; }
.lw-scene.world { background: none; } .lw-scene.out { opacity: 0; }
@keyframes lw-fade { from { opacity: 0; } }
.lw-scene-bar { flex: none; height: max(9vh, 54px); background: #05060b; display: flex; align-items: center; gap: 12px; padding: 0 calc(16px + var(--lw-safe-r)) 0 calc(16px + var(--lw-safe-l)); box-sizing: border-box; }
.lw-scene-bar.top { padding-top: var(--lw-safe-t); height: calc(max(9vh, 54px) + var(--lw-safe-t)); }
.lw-scene-bar.bottom { padding-bottom: var(--lw-safe-b); height: calc(max(9vh, 54px) + var(--lw-safe-b)); }
.lw-scene-mid { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 12px 22px; text-align: center; }
.lw-scene.world .lw-scene-mid { justify-content: flex-end; }
.lw-scene.world .lw-scene-text { background: #080910cc; padding: 12px 18px; border-radius: 14px; }
.lw-scene-art { width: min(190px, 34vh); } .lw-scene-art svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 0 16px #ffb52e66); }
.lw-scene-art.in { animation: lw-art 1s ease-out; } .lw-scene-art:empty { display: none; }
@keyframes lw-art { from { opacity: 0; transform: translateY(10px) scale(.96); } }
.lw-scene-text { margin: 0; max-width: 34em; font: clamp(18px, 2.6vw, 24px)/1.55 var(--lw-serif); color: var(--lw-text); text-shadow: 0 2px 0 #000; }
.lw-scene-dots { display: flex; gap: 6px; flex: 1; } .lw-scene-dots i { width: 8px; height: 8px; border-radius: 50%; background: #ffffff2e; } .lw-scene-dots i.on { background: var(--lw-amber); } .lw-scene-dots i.was { background: #ffb52e66; }
.lw-scene-skip { min-height: 40px; }

/* ---- down */
.lw-down { position: absolute; left: 50%; top: 60%; transform: translateX(-50%); width: min(340px, 86vw); box-sizing: border-box; padding: 12px 16px 14px; border-radius: 16px; background: var(--lw-panel); border: 2px solid #e8483a99; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 7px; box-shadow: 0 10px 34px #000a; }
.lw-down b { font: 700 20px/1.2 var(--lw-serif); color: #ffb1a4; }
.lw-down-text { font-size: 14px; color: var(--lw-text); }
.lw-down-bar { width: 100%; height: 8px; border-radius: 5px; background: #000a; overflow: hidden; display: none; } .lw-down-bar.on { display: block; }
.lw-down-bar i { display: block; height: 100%; width: 0; background: var(--lw-good); transition: width .2s; }
.lw-giveup { min-height: 44px; }

/* ---- notices */
.lw-notice { background: #0a0c14d9; z-index: 5; }
.lw-notice-card { width: min(420px, 100%); box-sizing: border-box; padding: 22px 22px 18px; border-radius: 18px; background: var(--lw-card); border: 1px solid var(--lw-line); text-align: center; box-shadow: 0 18px 60px #000c; }
.lw-notice-card h2 { margin: 0 0 8px; font: 700 23px/1.2 var(--lw-serif); color: var(--lw-amber-hi); }
.lw-notice-card p { margin: 0 0 16px; color: var(--lw-dim); line-height: 1.45; }
.lw-notice-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }
.lw-notice.calm .lw-flame { animation-duration: 2.4s; opacity: .7; }

/* ---- sheets (change look) */
.lw-sheet { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: #0a0c14c7; padding: 8px; box-sizing: border-box; }
.lw-sheet-card { width: min(520px, 100%); max-height: 100%; overflow: auto; box-sizing: border-box; padding: 16px 18px; border-radius: 18px; background: var(--lw-card); border: 1px solid var(--lw-line); box-shadow: 0 18px 60px #000c; }
.lw-sheet-card h2 { margin: 0 0 10px; font: 700 21px/1.2 var(--lw-serif); color: var(--lw-amber-hi); text-align: center; }
.lw-sheet-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

/* ---- touch controls: a floating stick on the left, buttons for the right thumb */
#lwTouch { position: fixed; inset: 0; z-index: 5; pointer-events: none; display: none; transition: opacity .15s; }
body[data-input="touch"] #lwTouch { display: block; }
/* a menu / dialog / scene owns the screen: the pad steps aside and takes no touches */
body.lw-held #lwTouch { opacity: 0; }
body.lw-held .lw-slots, body.lw-held .lw-prompt, body.lw-held .lw-boss { opacity: 0; transition: opacity .15s; }
body.lw-held #lwTouch * { pointer-events: none !important; }
body[data-input="touch"] .lw-slots, body[data-input="touch"] .lw-mb kbd { display: none; }
body[data-input="touch"] .lw-prompt { bottom: calc(250px + var(--lw-safe-b)); }
body[data-input="touch"] .lw-boss { bottom: auto; top: calc(188px + var(--lw-safe-t)); }      /* under the map and the menu buttons, clear of the objective */
body[data-input="touch"] .lw-mb { width: 46px; height: 46px; }
.lw-mb-touch { display: none; } body[data-input="touch"] .lw-mb-touch { display: block; }   /* the cheer: a key on a keyboard, a button on a phone */
body[data-input="touch"] .lw-chatlog { bottom: calc(252px + var(--lw-safe-b)); left: calc(8px + var(--lw-safe-l)); width: min(300px, 58vw); max-height: 88px; }
body[data-input="touch"] .lw-chatbar { bottom: auto; top: calc(8px + var(--lw-safe-t)); left: 8px; right: 8px; width: auto; }
body[data-input="touch"] .lw-chatlog.open { bottom: auto; top: calc(150px + var(--lw-safe-t)); max-height: 30vh; width: calc(100vw - 16px); }
.lw-stickzone { position: absolute; left: 0; top: 30%; bottom: 0; width: 50%; pointer-events: auto; touch-action: none; }
.lw-stick { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; background: #ffffff14; border: 2px solid #ffffff3d; opacity: 0; transition: opacity .12s; left: calc(86px + var(--lw-safe-l)); top: calc(100% - 110px - var(--lw-safe-b)); }
.lw-stick::after { content: ""; position: absolute; inset: 0; border-radius: 50%; }
.lw-stick.on { opacity: 1; }
/* a resting hint of where the stick lives, so a first-time player sees it */
body[data-input="touch"] .lw-stick:not(.on) { opacity: .45; }
.lw-stick-knob { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: #fff3d6aa; box-shadow: 0 2px 8px #0008; }
.lw-pad { position: absolute; right: var(--lw-safe-r); bottom: var(--lw-safe-b); width: 236px; height: 236px; pointer-events: none; }
.lw-tb { position: absolute; pointer-events: auto; touch-action: none; border-radius: 50%; border: 2px solid #ffffff55; background: #171a26b8; color: var(--lw-text); font: 700 15px/1 system-ui, sans-serif; display: grid; place-items: center; padding: 0; }
.lw-tb svg { width: 56%; height: 56%; pointer-events: none; }
.lw-tb svg.lw-ii { width: 68%; height: 68%; }
.lw-tb.on { background: #ffb52ecc; color: #2a2010; transform: scale(.94); }
.lw-tb.dim { opacity: .4; }
.lw-tb-n { position: absolute; right: -2px; top: -4px; min-width: 18px; padding: 2px 4px; border-radius: 9px; background: #10121c; border: 1px solid #ffb52e99; color: var(--lw-amber-hi); font: 700 11px/1 system-ui, sans-serif; text-align: center; box-sizing: border-box; pointer-events: none; }
.lw-tb-sword { width: 92px; height: 92px; right: 18px; bottom: 26px; border-color: #ffb52ecc; }
.lw-tb-shield { width: 66px; height: 66px; right: 122px; bottom: 16px; }
.lw-tb-roll { width: 62px; height: 62px; right: 110px; bottom: 96px; }
.lw-tb-ctx { width: 60px; height: 60px; right: 24px; bottom: 132px; font-size: 13px; border-color: #7fd0ffaa; }
.lw-tb-ctx:not(.dim) { background: #1f4a66d9; border-color: #bfeaff; box-shadow: 0 0 0 4px #7fd0ff33; }
.lw-tb-x { width: 54px; height: 54px; right: 96px; bottom: 172px; color: var(--lw-amber-hi); border-color: #ffb52e88; }
.lw-tb-y { width: 54px; height: 54px; right: 162px; bottom: 132px; color: var(--lw-amber-hi); border-color: #ffb52e88; }

/* ---- the hall of fame as a page (board.html): this stylesheet minus the full-screen canvas */
html:has(body.lw-page), body.lw-page { overflow: auto; height: auto; min-height: 100%; user-select: text; -webkit-user-select: text; }
body.lw-page { background: radial-gradient(ellipse at 50% 0%, #2a2440 0%, #0d0f17 60%) fixed; padding: 0 16px 48px; min-height: 100vh; box-sizing: border-box; }
.lw-bd { max-width: 900px; margin: 0 auto; }
.lw-bd-head { text-align: center; padding: 26px 0 4px; }
.lw-bd-head h1 { margin: 0 0 8px; font: 700 clamp(26px, 6vw, 40px)/1.1 var(--lw-serif); letter-spacing: .04em; color: var(--lw-amber-hi); text-shadow: 0 0 24px rgba(255, 181, 46, .45), 0 2px 0 #7a4a12; }
.lw-bd-head nav { display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: center; }
.lw-bd-lede { color: var(--lw-dim); font: italic 15px/1.5 var(--lw-serif); max-width: 66ch; margin: 12px auto 16px; text-align: center; }
.lw-bd-foot { color: var(--lw-dim); font-size: 12.5px; line-height: 1.6; margin: 18px auto 0; max-width: 72ch; text-align: center; }
#fullBoard .lb-panel { background: var(--lw-card); border: 1px solid var(--lw-line); border-radius: 16px; padding: 14px 16px 18px; }
#fullBoard .lb-title { display: none; }
#fullBoard .lb-row { font-size: 14px; padding: 6px 0; grid-template-columns: 2.4em minmax(9em, 2fr) repeat(var(--lb-cols, 1), minmax(4.6em, 1fr)); }
#fullBoard .lb-row + .lb-row { border-top: 1px solid #ffffff12; }

/* ---- dev bar (map viewer) */
#lwDev { position: fixed; left: 8px; bottom: 8px; z-index: 30; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; max-width: calc(100vw - 16px); padding: 5px 8px; border-radius: 10px; background: #0c0e14d9; font: 12px/1.2 system-ui, sans-serif; color: #e9e4d6; }
#lwDev select, #lwDev button { background: #262a36; color: #e9e4d6; border: 1px solid #454b5e; border-radius: 6px; padding: 2px 6px; font: inherit; }
#lwDev .stats { opacity: .8; font-variant-numeric: tabular-nums; }
body.shot #lwDev { display: none; }
body[data-input="touch"] #lwDev { bottom: auto; top: calc(150px + var(--lw-safe-t)); max-width: 62vw; }

@media (max-width: 720px) {
  .lw-tabs button span { display: none; }
  .lw-tabs button { padding: 7px 0; flex: 1; justify-content: center; max-width: 54px; }
  .lw-tabs button svg { width: 24px; height: 24px; }
  .lw-tabs .lw-x { flex: none; }
}
@media (max-width: 520px) {
  .lw-minimap { width: 96px; height: 80px; }
  .lw-zone-name { font-size: 10px; }
  .lw-candle svg { width: 19px; height: 28px; }
  .lw-glow { width: 108px; }
  .lw-objective { font-size: 13px; padding: 5px 8px 5px 9px; }
  .lw-toast { top: 236px; padding: 5px 16px; } .lw-toast span { font-size: 19px; }
  .lw-notes { top: 292px; }
  .lw-panel-card { width: calc(100vw - 12px); height: calc(100dvh - 20px - var(--lw-safe-t) - var(--lw-safe-b)); padding: 0 12px 14px; border-radius: 14px; }
  .lw-tabs { margin: 0 -12px 8px; padding: 8px 8px 6px; }
  .lw-collect { grid-template-columns: 1fr 1fr; }
  .lw-binds { font-size: 13px; } .lw-binds th:nth-child(3), .lw-binds td:nth-child(3) { display: none; }
  .lw-row { flex-wrap: wrap; }
  .lw-dlg { bottom: calc(12px + var(--lw-safe-b)); }
  .lw-dlg-box { padding: 20px 16px 26px; gap: 10px; }
  .lw-dlg-text { font-size: 17px; line-height: 1.45; }
  .lw-dlg-icon { width: 52px; height: 52px; align-self: flex-start; }
  .lw-shop-row { grid-template-columns: 40px 1fr auto; gap: 6px 10px; }
  .lw-shop-ico { width: 40px; height: 40px; }
  .lw-shop-row .lw-buy { grid-column: 3; grid-row: 1 / span 2; }
  .lw-shop-price { grid-column: 2; grid-row: 2; font-size: 16px; justify-self: start; }
  .lw-shop-what { grid-column: 2; }
  .lw-shop-ico { grid-row: 1 / span 2; }
  .lw-join-card { padding: 14px 14px 12px; gap: 8px; border-radius: 16px; }
  .lw-join-head .lw-flame { width: 26px; height: 36px; margin-bottom: 0; }
  .lw-join.creating .lw-tagline { display: none; }
  .lw-tagline { font-size: 14px; }
  .lw-picker { grid-template-columns: 1fr; gap: 4px; }
  .lw-picker-view { flex-direction: row; justify-content: center; gap: 12px; }
  .lw-chibi { width: 96px; }
  .lw-pk { grid-template-columns: 1fr; gap: 3px; }
  .lw-pk-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .lw-pk-pair .lw-seg button { min-height: 38px; padding: 0 4px; }
  .lw-picker-rows { gap: 6px; }
  .lw-join-help-rows { grid-template-columns: 1fr; }
  .lw-item-detail { gap: 10px; padding: 10px; } .lw-item-big { width: 56px; height: 56px; }
  .lw-get { width: calc(100vw - 194px); }               /* beside the menu buttons, not under them */
  .lw-mg.free { top: calc(190px + var(--lw-safe-t)); max-width: calc(100vw - 24px); }
  #fullBoard .lb-row { grid-template-columns: 2em minmax(0, 1fr) repeat(var(--lb-cols, 1), minmax(3.6em, auto)); }
  body.lw-page { padding: 0 10px 32px; }
}
@media (max-height: 460px) {
  .lw-minibtn { display: none; }
  .lw-toast { top: 14%; } .lw-notes { top: calc(14% + 76px); }
  body[data-input="touch"] .lw-boss { top: calc(6px + var(--lw-safe-t)); left: 56%; width: min(260px, 32vw); }           /* under the objective, which reaches the middle on a short screen */
  .lw-item-detail { position: static; box-shadow: none; }                /* a short panel: the detail must not cover the grid it describes */
  .lw-dlg-text { font-size: 16px; min-height: 2.4em; }
  .lw-dlg-box { padding: 16px 16px 14px; }
  .lw-scene-art { display: none; }
  .lw-down { top: 46%; }
  .lw-panel-card { height: calc(100dvh - 12px); }
  /* a phone on its side: the chat log goes between the stick and the pad, not over the objective */
  body[data-input="touch"] .lw-chatlog { left: calc(196px + var(--lw-safe-l)); bottom: calc(10px + var(--lw-safe-b)); width: min(380px, calc(100vw - 460px)); max-height: 66px; }
  body[data-input="touch"] .lw-chatlog.open { left: 8px; top: calc(118px + var(--lw-safe-t)); bottom: auto; width: calc(100vw - 260px); max-height: 44vh; }
}
@media (prefers-reduced-motion: reduce) {
  .lw-flame, .lw-candles.low svg, .lw-dlg-more i { animation: none !important; }
}
