[hidden] { display: none !important; }

:root {
  --bg: #181818;
  --panel: #1f1f1f;
  --panel-2: #272727;
  --line: rgba(228, 232, 236, .08);
  --line-strong: rgba(228, 232, 236, .14);
  --text: #e4e8ec;
  --muted: #8a96a3;
  --faint: #5d6874;
  --accent: #7cc9d4;
  --accent-ink: #061418;
  --elyos: #d6b25c;
  --asmo: #a08ae6;
  --danger: #e07780;
  --ok: #6ccf98;
  --r: 8px;
  --r-panel: 12px;
  --primary: #e9ecef;
  --primary-ink: #181818;
  --shadow: 0 8px 28px rgba(0, 0, 0, .4);
  --mono: "Geist Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ui: "Geist", system-ui, sans-serif;
  --head: "Geist", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { font: 14px/20px var(--ui); color: var(--text); background: var(--bg); }
h1, h2, h3 { margin: 0; font-family: var(--head); font-weight: 500; letter-spacing: 0; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--danger); min-height: 1.2em; font-size: 12px; }
.icon { width: 16px; height: 16px; flex: none; fill: currentColor; vertical-align: -3px; }

/* ---------- controls ---------- */
button { font: 500 14px/20px var(--ui); color: var(--text); cursor: pointer; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--panel-2); padding: 8px 16px; transition: background-color .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease); }
button:hover:not(:disabled) { border-color: var(--muted); }
button:active:not(:disabled) { transform: scale(.98); }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
button.primary:hover:not(:disabled) { background: #fff; border-color: #fff; }
button.primary.big { padding: 12px 16px; font-size: 16px; }
button.ghost { background: transparent; }
button.danger { background: transparent; border-color: color-mix(in srgb, var(--danger) 60%, transparent); color: var(--danger); }
button.danger:hover:not(:disabled) { border-color: var(--danger); }
button.link { background: none; border: 0; padding: 0; color: var(--muted); font-weight: 500; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
button.link:hover { color: var(--text); }
button.tiny { padding: 4px 8px; font-size: 12px; }
button.icon-btn { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; background: transparent; }
input, select { font: 500 14px/20px var(--ui); color: var(--text); background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--r); padding: 8px 12px; width: 100%; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label, .field { display: grid; gap: 8px; font-size: 12px; color: var(--muted); }
input[type=range] { padding: 0; accent-color: var(--accent); background: none; border: 0; }
.row { display: flex; gap: 8px; }
.row.end { justify-content: flex-end; }

.elyos { --f: var(--elyos); }
.asmodian { --f: var(--asmo); }
.fname { color: var(--f, var(--text)); font-weight: 600; }
.verified { display: inline-flex; margin-left: 4px; color: var(--accent); vertical-align: -2px; }
.verified .icon { width: 14px; height: 14px; vertical-align: 0; }
.sub .icon { width: 14px; height: 14px; color: var(--accent); vertical-align: -2px; }

/* ---------- character verification gate ---------- */
.modal.verify-modal { width: min(480px, calc(100vw - 32px)); display: grid; gap: 16px; }
.verify-modal h2 { font-size: 20px; line-height: 28px; font-weight: 500; letter-spacing: 0; }
.verify-modal > p { margin-top: -4px; }
.verify-body { display: flex; gap: 24px; align-items: flex-start; }
.verify-steps { flex: 1; min-width: 0; display: grid; gap: 12px; align-content: start; }
.verify-ask { font-size: 18px; line-height: 28px; font-weight: 500; }
.target-name { color: #ff5b5b; font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.verify-badge { padding: 12px; border-radius: var(--r); background: var(--panel-2); border: 1px solid var(--line); }
.verify-badge .mini { font-size: 14px; }
.verify-badge .mini b { font-size: 16px; }
.verify-steps .search-bar.wide { width: 100%; margin: 4px 0; }
.verify-steps .ghost { justify-self: start; }
.verify-steps .steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--text); }
.verify-note { color: var(--elyos); font-size: 14px; line-height: 20px; }
.verify-timer { font-size: 14px; line-height: 20px; }
.verify-timer #verify-left { font: 500 16px/24px var(--mono); font-variant-numeric: tabular-nums; }
.verify-foot { display: flex; justify-content: space-between; gap: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.verify-foot .link:only-child { margin-left: auto; }
.gear-bar { --cell: 40px; flex: none; display: grid; grid-template-columns: repeat(2, var(--cell)); gap: 4px; padding: 8px; border-radius: var(--r); background: #10131a; border: 1px solid var(--line); }
.gear-cell { width: var(--cell); height: var(--cell); border-radius: 2px; border: 1px solid rgba(255, 255, 255, .06); background: url(/img/gear-slots.webp) calc(var(--i) * var(--cell) * -1) 0 / calc(var(--cell) * 20) var(--cell); opacity: .45; }
.gear-cell.target { position: relative; opacity: 1; border-color: #ff4d4d; filter: sepia(1) saturate(6) hue-rotate(-40deg) brightness(1.15); box-shadow: 0 0 0 1px #ff4d4d, 0 0 14px 3px rgba(255, 64, 64, .65); animation: gear-pulse 1.6s var(--ease) infinite; }
@keyframes gear-pulse { 50% { box-shadow: 0 0 0 1px #ff4d4d, 0 0 22px 6px rgba(255, 64, 64, .85); } }

/* ---------- map ---------- */
.world { position: fixed; inset: 0; background: #0f1419; z-index: 0; }
.world.leaflet-container { font: inherit; }
.world[data-sea=elyos] { background: #24434a; }
.world[data-sea=asmodian] { background: #26323f; }
.world[data-sea=abyss] { background: #120f20; }
.world[data-sea=art] { background: #6f8495; }
.vignette { display: none; }
.leaflet-control-zoom { margin: 0 16px 24px 0 !important; border: 1px solid var(--line-strong) !important; border-radius: var(--r) !important; }
.leaflet-bar a { background: var(--panel) !important; color: var(--text) !important; border-color: var(--line) !important; }
.leaflet-control-attribution { background: rgba(11, 15, 20, .75) !important; color: var(--muted) !important; font-size: 12px; }
.leaflet-control-attribution a { color: var(--accent) !important; }
.leaflet-tooltip { background: var(--panel); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--r); box-shadow: none; font: 500 12px/16px var(--ui); padding: 4px 8px; }
.leaflet-tooltip-top:before { border-top-color: var(--line-strong); }
.leaflet-tooltip-bottom:before { border-bottom-color: var(--line-strong); }
.tip { font-weight: 600; }
.tele-tip { color: var(--accent); }
.meet-tip { color: var(--text); border-color: var(--text); }

.zone-label { color: #f2efe6; font: 500 12px/16px var(--head); letter-spacing: 0; text-align: center; white-space: nowrap; pointer-events: none; text-shadow: 0 1px 2px #000; }
.labels-off .zone-label { display: none; }
.terrain:hover { fill-opacity: .85; }
.hit { background: none; border: 0; border-radius: 50%; cursor: pointer; }
.hit:hover { box-shadow: 0 0 0 2px var(--accent); }
.pin-wrap { background: none; border: 0; }
.pin-wrap .pin { display: block; width: 100%; height: 100%; }
.pin { border-radius: 50%; border: 2px solid #0b0f14; }
.pin.teleport { background: var(--accent); border-radius: 2px; transform: rotate(45deg) scale(.8); }
.pin.teleport.big { box-shadow: 0 0 0 2px #fff; }
.pin.target { background: var(--danger); }
.pin.spot { background: var(--elyos); }

.meet { position: relative; }
.meet .ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid #fff; animation: ping 1.8s ease-out infinite; }
.meet .core { position: absolute; inset: 11px; border-radius: 50%; background: #fff; color: #0b0f14; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .6); }
.meet .core .icon { width: 16px; height: 16px; }
@keyframes ping { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }

.pick-flag { background: none; border: 0; }
.pick-flag .flag { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #fff; color: #0b0f14; box-shadow: 0 2px 8px rgba(0, 0, 0, .6); cursor: grab; }
.pick-flag.proposed .flag { background: var(--accent); cursor: default; }
.pick-flag .icon { width: 16px; height: 16px; }

.me-pin { display: block; width: 36px; height: 36px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--f, var(--accent)); border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .6); overflow: hidden; }
.me-pin img { width: 100%; height: 100%; object-fit: cover; transform: rotate(45deg) scale(1.15); }
.me-pin.small { width: 28px; height: 28px; cursor: grab; flex: none; touch-action: none; }
.me-pin-wrap { background: none; border: 0; }
.ghost-pin { position: fixed; z-index: 2000; width: 36px !important; height: 36px !important; pointer-events: none; opacity: .9; }

/* ---------- top bar ---------- */
.hud-top { position: fixed; top: 0; left: 0; right: 0; z-index: 500; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 12px 24px; background: var(--bg); border-bottom: 1px solid var(--line); }

.title { display: flex; align-items: center; gap: 12px; }
.title small { display: block; color: var(--muted); font: 500 12px/16px var(--head); letter-spacing: 0; }
.title h1 { font-size: 24px; line-height: 1.1; }
.sigil { color: var(--accent); display: grid; }
.sigil .icon { width: 26px; height: 26px; stroke-width: 1.6; }
.sigil.big { justify-items: center; }
.sigil.big .icon { width: 40px; height: 40px; }
.mode-tabs { display: flex; gap: 4px; }
.mode-tabs button { background: none; border: 0; border-radius: 0; padding: 8px 4px; color: var(--muted); font: 500 16px/24px var(--head); letter-spacing: 0; border-bottom: 2px solid transparent; }
.mode-tabs button.active { color: var(--text); border-bottom-color: var(--text); }
.hud-right { grid-column: 3; display: flex; justify-content: flex-end; align-items: center; gap: 16px; }
.clock { text-align: right; font-size: 12px; line-height: 16px; white-space: nowrap; }
.clock .live { color: var(--ok); }
.clock .warm { color: var(--elyos); }
.online { font-size: 12px; line-height: 16px; color: var(--muted); white-space: nowrap; }
.online .dot { display: inline-block; margin-right: 8px; vertical-align: 1px; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.online b { color: var(--text); font-weight: 600; }
.me-card { display: flex; align-items: center; gap: 12px; padding: 4px 8px 4px 4px; border-radius: var(--r-panel); background: var(--panel); border: 1px solid var(--line); font-size: 12px; }
.me-card img { width: 32px; height: 32px; border-radius: var(--r); object-fit: cover; }
.me-card > div { white-space: nowrap; }
.me-card .cp { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- side panel ---------- */
.side { position: fixed; top: calc(var(--hud-h, 80px) + 16px); left: 16px; bottom: 16px; width: 280px; z-index: 500; display: flex; flex-direction: column; gap: 24px; overflow-y: auto; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); }
.side h2 { font-size: 12px; color: var(--muted); letter-spacing: 0; margin-bottom: 8px; }
.vs-line { font-size: 16px; margin-bottom: 4px; }
.vs-line em { color: var(--faint); font-style: normal; margin: 0 8px; font-size: 12px; }
.side .sub { color: var(--muted); font-size: 12px; line-height: 1.5; }
.map-list { display: grid; }
.map-group-label { font: 500 12px/16px var(--head); letter-spacing: 0; color: var(--faint); margin: 8px 0 2px; }
.map-item { display: flex; justify-content: space-between; align-items: baseline; text-align: left; border: 0; border-radius: var(--r); background: transparent; padding: 8px 8px; margin: 0 -8px; width: calc(100% + 16px); }
.map-item:hover { background: var(--panel-2); }
.map-item b { font-weight: 600; color: var(--accent); }
.map-item small { color: var(--faint); font-weight: 500; }
.map-item.active { background: var(--panel-2); }
.map-item.active b { color: var(--text); }
.block-list { display: grid; gap: 2px; }
.blocked { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; font-size: 12px; }
.credit { font-size: 12px; color: var(--faint); margin-top: auto; }

/* ---------- find duel ---------- */
.center-stage { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 500; }
.find { display: grid; gap: 12px; width: 360px; padding: 16px; border-radius: var(--r-panel); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.here { display: grid; gap: 8px; font: 500 12px/16px var(--head); color: var(--muted); letter-spacing: 0; }
.here-maps { display: flex; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; }
.here-btn { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.here-btn { border: 0; border-radius: 0; background: transparent; padding: 8px 16px; color: var(--muted); font-size: 14px; text-transform: none; letter-spacing: 0; }
.here-btn + .here-btn { border-left: 1px solid var(--line-strong); }
.here-btn.active { color: var(--accent-ink); background: var(--f, var(--accent)); }
.drag-me { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); }
.drag-me em { color: var(--faint); font-style: normal; }
.find-btn { display: grid; width: 100%; padding: 12px 16px; background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.find-btn:hover:not(:disabled) { background: #fff; }
.find-btn span { font: 500 20px/28px var(--head); }
.find-sub { margin-top: -4px; text-align: center; font-size: 12px; line-height: 16px; color: var(--muted); text-wrap: balance; }
.formats { display: flex; gap: 4px; }
.formats button { flex: 1; padding: 4px 0; font-size: 12px; background: transparent; color: var(--muted); border-color: var(--line); }
.formats button.active { color: var(--text); border-color: var(--accent); }
.cp-range { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.cp-range span { white-space: nowrap; }
.cp-range b { color: var(--text); font-variant-numeric: tabular-nums; }
.cp-range input { flex: 1; }

.finding { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 700; }
.finding-card { display: grid; justify-items: center; gap: 4px; width: 320px; padding: 24px 24px 16px; border-radius: var(--r-panel); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); text-align: center; }
.finding-card h3 { font-size: 18px; letter-spacing: 0; }
.finding-card .elapsed { font: 600 24px/32px var(--ui); font-variant-numeric: tabular-nums; }
.finding-card button { margin-top: 12px; min-width: 120px; }
.search-bar { position: relative; width: 120px; height: 2px; margin-bottom: 12px; overflow: hidden; border-radius: 2px; background: var(--line-strong); }
.search-bar span { position: absolute; inset: 0; width: 40%; background: var(--accent); animation: sweep 1.4s var(--ease) infinite; }
@keyframes sweep { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }

/* ---------- duel panel ---------- */
.duel-panel { position: fixed; top: calc(var(--hud-h, 80px) + 16px); right: 16px; z-index: 650; width: 340px; max-height: calc(100vh - var(--hud-h, 80px) - 32px); overflow: auto; overflow-x: hidden; display: grid; gap: 12px; padding: 16px; border-radius: var(--r-panel); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.duel-panel.active { max-height: calc(100vh - 84px - 300px); }
.duel-panel header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.duel-panel h3 { font-size: 16px; letter-spacing: 0; }
.fmt { font: 500 12px/16px var(--head); letter-spacing: 0; color: var(--muted); }
.group-note { margin-top: -8px; }
.mini { display: grid; grid-template-columns: 34px 1fr auto auto; gap: 12px; align-items: center; font-size: 12px; }
.mini img, .mini .ph { width: 34px; height: 34px; border-radius: var(--r); object-fit: cover; background: var(--panel-2); }
.mini b { font-weight: 600; }
.mini .cp { font-weight: 600; color: var(--f); font-variant-numeric: tabular-nums; }
.mini .ready { color: var(--faint); display: grid; }
.mini .ready.yes { color: var(--ok); }
.vs-mini { font: 500 12px/16px var(--head); color: var(--faint); letter-spacing: 0; padding-left: 48px; margin: -8px 0; }
.countdown { height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.countdown .bar { height: 100%; background: var(--accent); transition: width .3s linear; }
.block-row { justify-content: center !important; }
.steps { margin: 0; padding-left: 16px; line-height: 1.6; }
.steps.compact { font-size: 12px; }
.steps b { color: var(--accent); font-weight: 600; }
.ask-inline { padding: 12px; border-radius: var(--r); background: var(--panel-2); border: 1px solid var(--line-strong); }
.ask-inline p { margin-bottom: 12px; font-size: 14px; }
.ask-inline b { color: var(--accent); }

.relocate-choice { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; pointer-events: none; }
.choice-card { pointer-events: auto; display: grid; gap: 8px; width: 280px; padding: 24px; border-radius: var(--r-panel); background: var(--panel); border: 1px solid var(--line-strong); box-shadow: var(--shadow); }
.choice-card h3 { font-size: 16px; letter-spacing: 0; margin-bottom: 4px; }
.choice-card .link { justify-self: center; margin-top: 4px; }

/* ---------- chat ---------- */
.chat-panel { position: fixed; right: 16px; bottom: 16px; z-index: 640; width: 340px; height: 260px; display: flex; flex-direction: column; border-radius: var(--r-panel); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.chat-panel header { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 16px; border-bottom: 1px solid var(--line); font: 500 14px/20px var(--head); letter-spacing: 0; }
.chat-panel header small { font: 500 12px/16px var(--ui); letter-spacing: 0; text-transform: none; }
.chat-log { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.msg { max-width: 85%; align-self: flex-start; word-wrap: break-word; }
.msg b { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.msg span { display: inline-block; padding: 4px 8px; border-radius: var(--r); background: var(--panel-2); }
.msg.mine { align-self: flex-end; text-align: right; }
.msg.mine span { background: color-mix(in srgb, var(--accent) 20%, var(--panel-2)); }
.empty-chat { margin: auto; text-align: center; color: var(--faint); }
.chat-panel form { display: flex; gap: 8px; padding: 8px; border-top: 1px solid var(--line); }
.chat-panel input { padding: 8px 12px; font-size: 14px; }
.chat-panel form button { padding: 8px 12px; }

/* ---------- modals ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; background: rgba(6, 9, 12, .6); }
.modal-backdrop.solid { background: rgba(6, 9, 12, .78); }
.modal { width: min(400px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r-panel); box-shadow: var(--shadow); padding: 24px; }
.modal.login { display: grid; gap: 16px; }
.modal.login h2 { text-align: center; font-size: 24px; letter-spacing: 0; }
.modal.login > p { text-align: center; }
.modal.login { width: min(560px, calc(100vw - 32px)); }
.login-step { display: grid; gap: 16px; }
.login-step[hidden] { display: none; }
.step-head { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 40px; position: relative; }
.step-head h2 { font-size: 18px; line-height: 28px; font-weight: 500; text-align: center; }
.step-head h2 small { font-size: 14px; font-weight: 400; margin-left: 4px; }
.step-head .step-back { position: absolute; left: 0; }
.login-step > p.small { text-align: center; }

.region-list { display: grid; border-top: 1px solid var(--line); }
.region-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 52px; padding: 0 16px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--text); font: 500 16px/24px var(--ui); text-align: left; }
.region-row:hover { background: var(--panel-2); }
.region-row.active { background: rgba(124, 201, 212, .1); box-shadow: inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent); }
.sig { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.sig i { width: 3px; border-radius: 1px; background: var(--line-strong); }
.sig i:nth-child(1) { height: 4px; } .sig i:nth-child(2) { height: 7px; } .sig i:nth-child(3) { height: 10px; } .sig i:nth-child(4) { height: 14px; }
.sig.good i.on { background: #4cd964; }
.sig.ok i.on { background: #f0b429; }
.sig.bad i.on { background: #ff4d4d; }
.sig.measuring i { animation: sig-wait 1.2s var(--ease) infinite; }
.sig.measuring i:nth-child(2) { animation-delay: .15s; } .sig.measuring i:nth-child(3) { animation-delay: .3s; } .sig.measuring i:nth-child(4) { animation-delay: .45s; }
@keyframes sig-wait { 50% { background: var(--muted); } }
.sig.none { align-items: center; color: #ff4d4d; font: 500 12px/16px var(--mono); letter-spacing: 1px; }

.server-tools input { width: 100%; }
.server-list { display: grid; gap: 16px; max-height: min(420px, 52dvh); overflow: auto; }
.server-group h3 { margin-bottom: 4px; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--f, var(--muted)); }
.server-group.elyos { --f: var(--elyos); } .server-group.asmodian { --f: var(--asmo); }
.server-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
.server-row { display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 12px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--text); text-align: left; }
.server-row b { font-size: 16px; line-height: 24px; font-weight: 500; }
.server-row:hover { background: var(--panel-2); }
.server-row.active { background: rgba(124, 201, 212, .1); box-shadow: inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent); }

.toast { position: fixed; top: calc(var(--hud-h, 80px) + 16px); left: 50%; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--line-strong); padding: 8px 16px; border-radius: var(--r-panel); box-shadow: var(--shadow); z-index: 1000; font-size: 14px; }

.tp-num { display: inline-block; min-width: 1.6em; padding: 0 4px; margin-right: 4px; border: 1px solid var(--line-strong); border-radius: 4px; font: 500 12px/16px var(--mono); color: var(--muted); text-align: center; vertical-align: 1px; }
.tele-tip .tp-num, .steps .tp-num, .ask-inline .tp-num { color: var(--accent); border-color: rgba(124, 201, 212, .35); }

/* ---------- mobile chrome, hidden on desktop ---------- */
button.menu-btn, .drawer-scrim, button.chat-toggle { display: none; }
.chat-toggle { position: fixed; z-index: 660; right: 16px; width: 48px; height: 48px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line-strong); box-shadow: var(--shadow); place-items: center; padding: 0; }
.chat-toggle .icon { width: 20px; height: 20px; }
.chat-toggle .unread { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--primary); color: var(--primary-ink); font: 600 .7rem/18px var(--ui); text-align: center; }

@media (max-width: 760px) {
  html, body { height: 100dvh; }
  body { font-size: 14px; }
  .leaflet-control-zoom { display: none; }

  /* top bar: title row + one status row */
  .hud-top { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 8px 8px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; }
  .title { gap: 8px; min-width: 0; }
  .title > div { min-width: 0; }
  .title h1 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .title small { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sigil { display: none; }
  button.menu-btn:not([hidden]) { display: grid; margin-left: -8px; }
  .mode-tabs { display: none !important; }
  .hud-right { display: contents; }
  .me-card { grid-column: 2; grid-row: 1; justify-self: end; padding: 4px; gap: 4px; }
  .me-card > div { display: none; }
    .me-card img { width: 30px; height: 30px; }
  .online, .clock { grid-row: 2; font-size: 12px; white-space: nowrap; }
  .online { grid-column: 1; }
  .online .extra { display: none; }
  .clock { grid-column: 2; text-align: right; }
  .clock br, .clock .muted { display: none; }

  /* side panel becomes a drawer */
  .side { top: 0; left: 0; bottom: 0; width: min(300px, 86vw); border-radius: 0; border-width: 1px; padding: calc(16px + env(safe-area-inset-top)) 16px 16px; transform: translateX(-102%); transition: transform .5s var(--ease); z-index: 950; }
  .side-open .side { transform: none; }
  .drawer-scrim { display: block; position: fixed; inset: 0; z-index: 940; background: rgba(6, 9, 12, .55); opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }
  .side-open .drawer-scrim { opacity: 1; pointer-events: auto; }
  .map-item { padding: 12px 8px; }

  /* bottom sheets */
  .center-stage, .finding { left: 0; right: 0; bottom: 0; transform: none; }
  .find, .finding-card { width: 100%; border-radius: var(--r-panel) var(--r-panel) 0 0; border-width: 1px; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); gap: 12px; }
  .finding-card { padding-top: 16px; }
  .find-btn { padding: 12px 16px; }
  .find-btn span { font-size: 18px; }
  .here-btn { padding: 8px 12px; }

  /* duel panel: centred dialogs stay centred, the running duel docks at the bottom */
    .duel-panel.active { top: auto; right: 0; left: 0; bottom: 0; width: 100%; max-height: 46dvh; border-radius: var(--r-panel) var(--r-panel) 0 0; border-width: 1px; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); gap: 12px; }
  .duel-panel.active .vs-mini { display: none; }
  .duel-panel.active .mini.self { display: none; }
  .duel-panel.active .row.end { flex-wrap: wrap; }
  .duel-panel.active .row.end > button { flex: 1; }
  .duel-panel .block-row { flex: none; }

  /* chat: a floating button opens a sheet */
  button.chat-toggle:not([hidden]) { display: grid; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 640; }
  .duel-docked button.chat-toggle { bottom: calc(46dvh + 12px); z-index: 660; }
  .chat-panel { display: none; }
  .chat-open .chat-panel:not([hidden]) { display: flex; left: 0; right: 0; bottom: 0; width: 100%; height: min(60dvh, 420px); border-radius: var(--r-panel) var(--r-panel) 0 0; z-index: 960; padding-bottom: env(safe-area-inset-bottom); }
  body.chat-open button.chat-toggle { bottom: calc(min(60dvh, 420px) + 12px); z-index: 970; }

    .choice-card { width: calc(100vw - 48px); }
  .toast { top: calc(84px + env(safe-area-inset-top)); max-width: calc(100vw - 24px); }

  .modal.login { padding: 16px; gap: 12px; }
  .server-grid { column-gap: 8px; }
  .server-tools   .modal.verify-modal { padding: 16px; max-height: calc(100dvh - 24px); overflow: auto; }
  .verify-body { gap: 16px; }
  .gear-bar { --cell: 32px; padding: 6px; }
  .verify-ask { font-size: 16px; line-height: 24px; }
    .leaflet-tooltip { font-size: 12px; }
}

h1, h2, h3, .finding-card h3 { text-wrap: balance; }
p, li, .sub, .steps, .msg span { text-wrap: pretty; }
.skip-link { position: fixed; top: -48px; left: 16px; z-index: 3000; padding: 8px 12px; border-radius: var(--r); background: var(--primary); color: var(--primary-ink); font: 600 14px/20px var(--ui); text-decoration: none; transition: top .3s var(--ease); }
.skip-link:focus { top: 8px; }
.credit a { color: var(--muted); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: opacity .2s linear !important; }
  .side { transition: none !important; }
}

/* card hanging under a map point: spot proposals and picking a spot */
.spot-card-wrap { width: 260px !important; height: auto !important; }
.spot-card { position: relative; display: grid; gap: 8px; padding: 12px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line-strong); box-shadow: var(--shadow); color: var(--text); font: 400 14px/20px var(--ui); cursor: default; }
.spot-card p { margin: 0; text-wrap: balance; }
.spot-card .row { gap: 8px; }
.spot-card .row > button { flex: 1; }
.spot-card-arrow { position: absolute; top: -6px; left: calc(50% - 6px); width: 12px; height: 12px; transform: rotate(45deg); background: var(--panel); border-left: 1px solid var(--line-strong); border-top: 1px solid var(--line-strong); }
