:root { --fg: #e8ecff; --muted: #9aa3c7; --panel: rgba(12, 16, 36, .72); --line: rgba(140, 160, 255, .25); --accent: #7cc4ff; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #05060f; color: var(--fg); font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
canvas#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
.hidden { display: none !important; }
.small { font-size: 12.5px; color: var(--muted); }
a { color: var(--accent); }
button { font: inherit; color: inherit; cursor: pointer; }

#loading { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px;
  background: radial-gradient(ellipse at 50% 40%, #1a1f4a 0%, #05060f 70%); transition: opacity .8s; }
#loading.done { opacity: 0; pointer-events: none; }
#loading h1 { margin: 0 0 6px; font-size: clamp(28px, 6vw, 48px); letter-spacing: .04em; background: linear-gradient(90deg, #9fd8ff, #d6a8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
#loading p { margin: 4px 0; max-width: 520px; }
.bar { width: min(320px, 70vw); height: 6px; border-radius: 3px; background: rgba(255,255,255,.1); margin: 18px 0 6px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7cc4ff, #c58bff); transition: width .2s; }
.seo-list { list-style: none; padding: 0; margin: 18px 0 0; font-size: 13px; color: var(--muted); max-width: 560px; }
.seo-list li { margin: 3px 0; }

.hud { position: fixed; z-index: 5; pointer-events: none; }
.hud button, .hud a { pointer-events: auto; }
#hud-top { top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: max(10px, env(safe-area-inset-top)) 14px 10px; }
.brand { font-weight: 700; letter-spacing: .05em; text-shadow: 0 1px 6px #000; opacity: .9; }
.buttons { display: flex; gap: 8px; }
.buttons button, #tbtns button { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; backdrop-filter: blur(6px); }
.buttons button:hover { border-color: var(--accent); }
#btn-teleport { color: #ffe37a; }
body.embed .brand { display: none; }

#labels { position: fixed; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.plabel { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); white-space: nowrap; pointer-events: auto; cursor: pointer;
  background: rgba(8, 10, 26, .55); border: 1px solid var(--c, var(--line)); border-radius: 999px; padding: 3px 10px 3px 8px; font-size: 13px;
  text-shadow: 0 1px 3px #000; transition: opacity .2s; user-select: none; }
.plabel i { color: var(--c); margin-right: 5px; }
.plabel .d { color: var(--muted); font-size: 11px; margin-left: 6px; }
.plabel.target { box-shadow: 0 0 12px var(--c); }

#prompt { left: 50%; bottom: max(110px, 16vh); transform: translateX(-50%); background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 16px; text-align: center; backdrop-filter: blur(6px); max-width: 90vw; }
#prompt kbd, kbd { display: inline-block; min-width: 1.6em; padding: 0 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: rgba(255,255,255,.08); font: 600 12px/1.6 ui-monospace, monospace; text-align: center; }
#info { left: 14px; top: 56px; max-width: min(320px, 70vw); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; backdrop-filter: blur(6px); }
#info h2 { margin: 0 0 4px; font-size: 16px; }
#info h2 i { color: var(--c); margin-right: 6px; }
#info p { margin: 0; font-size: 13px; color: var(--muted); }
#speed { right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); font: 12px ui-monospace, monospace; color: var(--muted); text-shadow: 0 1px 3px #000; }
#flash { position: fixed; inset: 0; z-index: 15; pointer-events: none; opacity: 0; background: radial-gradient(circle, #fff 0%, #bfe6ff 40%, #6aa8ff 100%); transition: opacity .6s; }

dialog { background: rgba(10, 13, 32, .94); color: var(--fg); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; width: min(560px, 94vw); max-height: 86vh; }
dialog::backdrop { background: rgba(0, 0, 8, .5); backdrop-filter: blur(2px); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; margin: 0; }
.dlg-head h2 { margin: 0; font-size: 18px; }
.dlg-head button { background: none; border: 0; font-size: 18px; color: var(--muted); }
#tp-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
#tp-list li { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.03); }
#tp-list .ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #071022; }
#tp-list b { display: block; }
#tp-list span { font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#tp-list .acts { display: flex; gap: 6px; }
#tp-list .acts button { border: 1px solid var(--line); background: rgba(255,255,255,.06); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
#tp-list .acts .go { background: linear-gradient(90deg, #ffd85a, #ff9f43); color: #1a1000; border: 0; font-weight: 600; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cols h3 { margin: 10px 0 4px; font-size: 14px; }
.cols p { margin: 0; line-height: 1.9; font-size: 13px; }
@media (max-width: 560px) { .cols { grid-template-columns: 1fr; } .buttons button span { display: none; } #info { top: auto; bottom: 200px; } }

#touch { position: fixed; inset: auto 0 0 0; height: 200px; z-index: 6; pointer-events: none; }
#stick { position: absolute; left: max(22px, env(safe-area-inset-left)); bottom: max(26px, env(safe-area-inset-bottom)); width: 130px; height: 130px; border-radius: 50%;
  background: rgba(255,255,255,.06); border: 1px solid var(--line); pointer-events: auto; touch-action: none; }
#knob { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px; border-radius: 50%; background: rgba(124,196,255,.35); border: 1px solid var(--accent); }
#tbtns { position: absolute; right: max(18px, env(safe-area-inset-right)); bottom: max(26px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(2, 64px); gap: 10px; pointer-events: auto; }
#tbtns button { width: 64px; height: 64px; border-radius: 50%; font-size: 20px; touch-action: none; user-select: none; -webkit-user-select: none; }
#tbtns button.on { background: rgba(124,196,255,.35); }
#t-act { color: #ffe37a; font-weight: 700; }
