:root { --bg: rgba(16, 18, 22, .78); --line: rgba(255, 255, 255, .14); --fg: #f3f1ec; --dim: #a9a69e; --acc: #e9b872; --ok: #7fd1a0; --warn: #f0a35e; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1b1c1f; color: var(--fg); font: 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-user-select: none; user-select: none; overscroll-behavior: none; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#view.drag { cursor: grabbing; }
#top { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 12px 0 12px; pointer-events: none; }
#brand { background: var(--bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 10px; padding: 7px 11px; letter-spacing: .02em; }
#brand b { color: var(--acc); }
#where { color: var(--dim); margin-left: 10px; font-variant-numeric: tabular-nums; }
#badge { border-radius: 10px; padding: 7px 11px; font-weight: 600; font-size: 12px; background: var(--bg); border: 1px solid var(--line); max-width: 55vw; margin-right: 46px; text-align: right; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
#badge.official { color: var(--ok); border-color: rgba(127, 209, 160, .5); }
#badge.master { color: var(--warn); border-color: rgba(240, 163, 94, .55); }
#modes { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); max-width: calc(100vw - 16px); }
#modes button { appearance: none; border: 0; background: transparent; color: var(--dim); font: inherit; padding: 8px 12px; border-radius: 10px; cursor: pointer; display: flex; gap: 7px; align-items: center; white-space: nowrap; }
#modes button kbd { font: 600 11px ui-monospace, monospace; border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; color: var(--dim); }
#modes button.on { background: var(--acc); color: #1b1408; font-weight: 600; }
#modes button.on kbd { border-color: rgba(0, 0, 0, .3); color: #1b1408; }
#modes button:disabled { opacity: .35; cursor: not-allowed; }
#panel { position: fixed; top: calc(10px + env(safe-area-inset-top)); right: 10px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; max-height: calc(100vh - 90px); }
#panelToggle { width: 36px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font-size: 16px; cursor: pointer; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
#panelBody { width: min(372px, calc(100vw - 20px)); overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px 12px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); -webkit-user-select: text; user-select: text; }
#panel.closed #panelBody { display: none; }
#panel h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin: 12px 0 6px; font-weight: 600; }
#panel label { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 5px 0; }
#panel label.chk { justify-content: flex-start; }
select, #panel button { font: inherit; color: var(--fg); background: rgba(255, 255, 255, .08); border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px; }
#panel button { cursor: pointer; }
#panel button:hover { background: rgba(255, 255, 255, .16); }
.row { display: flex; gap: 6px; margin-top: 8px; }
#live { font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; color: #dcd9d2; white-space: pre-wrap; }
#log { width: 100%; border-collapse: collapse; font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
#log th { text-align: right; color: var(--dim); font-weight: 500; padding: 2px 3px; border-bottom: 1px solid var(--line); }
#log td { text-align: right; padding: 2px 3px; font-variant-numeric: tabular-nums; }
#log th:first-child, #log td:first-child, #log th:nth-child(2), #log td:nth-child(2) { text-align: left; }
#log td.bad { color: var(--warn); }
#benchStatus { color: var(--dim); margin-top: 6px; min-height: 1.3em; }
#sources div { margin: 3px 0; }
#sources .o { color: var(--ok); } #sources .m { color: var(--warn); }
#map { position: fixed; left: 10px; bottom: calc(14px + env(safe-area-inset-bottom)); width: 160px; height: 160px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); cursor: pointer; }
#toast { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; opacity: 0; transition: opacity .25s; pointer-events: none; max-width: 86vw; text-align: center; }
#toast.show { opacity: 1; }
#loading { position: fixed; inset: 0; background: #1b1c1f; display: grid; place-items: center; transition: opacity .4s; }
#loading div { display: grid; gap: 8px; text-align: center; } #loading b { font-size: 20px; letter-spacing: .04em; } #loading span { color: var(--dim); }
#loading.done { opacity: 0; pointer-events: none; }
@media (max-width: 720px) {
  #modes button span { display: none; } #modes button.on span { display: inline; }
  #map { width: 104px; height: 104px; bottom: calc(68px + env(safe-area-inset-bottom)); }
  #badge { font-size: 11px; max-width: 46vw; }
  #panel { max-height: calc(100vh - 150px); }
}

#floorBtn { position: fixed; left: 10px; bottom: calc(184px + env(safe-area-inset-bottom)); padding: 7px 12px; background: var(--bg); color: inherit; border: 1px solid var(--line); border-radius: 10px; font: 600 13px system-ui; cursor: pointer; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
@media (max-width: 700px) { #floorBtn { bottom: calc(180px + env(safe-area-inset-bottom)); } }
