:root {
  --pad: 8px;
  --glass: rgba(4, 16, 32, 0.52);
  --glass-edge: rgba(80, 220, 255, 0.32);
  --accent: #5ce1ff;
}
html, body {
  margin: 0; height: 100%; background: #02040c; color: #e8f4ff;
  font: 13px/1.4 Segoe UI, sans-serif; overflow: hidden;
  color-scheme: dark; accent-color: #5ce1ff; touch-action: none;
}
.glass {
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.45);
  -webkit-backdrop-filter: blur(18px) saturate(1.45);
  border: 1px solid var(--glass-edge);
  box-shadow: 0 10px 36px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.08);
}
#c { position: fixed; inset: 0; z-index: 1; display: block; width: 100%; height: 100%; touch-action: none; }
.galaxy {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 38% 30% at 50% 50%, rgba(56,214,255,.16), transparent 62%),
    radial-gradient(ellipse 50% 38% at 78% 22%, rgba(251,146,60,.10), transparent 58%),
    radial-gradient(ellipse 42% 36% at 18% 72%, rgba(167,139,250,.12), transparent 55%);
}
#brand { position: fixed; z-index: 8; left: var(--pad); top: var(--pad); pointer-events: none; text-shadow: 0 1px 2px #000; }
#brand .name { font: 700 14px Segoe UI, sans-serif; color: var(--accent); }
#brand .tag { font-size: 11px; color: #93c5fd; }
#dock {
  position: fixed; z-index: 8; left: 50%; top: var(--pad); transform: translateX(-50%);
  display: flex; flex-wrap: wrap; gap: 8px; padding: 5px 7px; border-radius: 14px; max-width: min(720px, 70vw);
}
#dock button {
  appearance: none; min-height: 36px; padding: 0 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid rgba(80,220,255,.32); background: rgba(8,28,44,.4); color: #e8f4ff;
  font: 600 12px Segoe UI, sans-serif;
}
#dock button.is-on { border-color: #5ce1ff; color: #5ce1ff; background: rgba(56,214,255,.14); }
#hud { position: fixed; z-index: 2; left: var(--pad); top: 58px; width: min(280px, 32vw); font-size: 11px; pointer-events: none; text-shadow: 0 1px 2px #000; }
#desk {
  position: fixed; z-index: 6; left: var(--pad); bottom: var(--pad); top: auto;
  width: min(520px, 46vw); height: min(34vh, 300px);
  display: flex; flex-direction: column; overflow: hidden; border-radius: 12px;
  --desk-zoom: 1;
}
#desk-bar { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 10px; cursor: grab; border-bottom: 1px solid rgba(180,168,230,.22); touch-action: none; user-select: none; }
#desk.is-locked #desk-bar { cursor: default; }
#d-head { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #8be9ff; font-weight: 600; }
#desk-tools { display: flex; gap: 4px; }
#desk-tools button, #desk button.walk, #d-steps button, #claim-slot button {
  min-height: 32px; padding: 0 10px; border-radius: 8px; cursor: pointer;
  background: rgba(8,28,44,.4); color: #e8f4ff; border: 1px solid rgba(80,220,255,.4);
  font: 600 12px Segoe UI, sans-serif;
}
#desk-body { flex: 1; overflow: auto; padding: 8px 10px; font-size: calc(13px * var(--desk-zoom)); touch-action: pan-y; }
#desk-grip {
  position: absolute; right: 0; bottom: 0; width: 32px; height: 32px; cursor: nwse-resize; touch-action: none;
  background: linear-gradient(135deg, transparent 52%, rgba(80,220,255,.7) 52%);
}
#desk.is-locked #desk-grip { display: none; }
.k { color: #a78bfa; font-size: 0.85em; }
#d-why { color: #c8c0e8; font-size: 12px; margin: 4px 0 6px; }
#d-steps { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
#d-steps button.is-on { border-color: #5ce1ff; color: #5ce1ff; }
#picker {
  position: fixed; z-index: 6; right: var(--pad); top: var(--pad);
  width: min(280px, 30vw); max-height: min(42vh, 360px);
  display: flex; flex-direction: column; overflow: hidden; border-radius: 12px;
}
#pick-body { flex: 1; overflow: auto; padding: 8px; touch-action: pan-y; }
#picker select, #picker .moon {
  width: 100%; box-sizing: border-box; margin: 0 0 6px;
  background: #0b1c2c; color: #e8f4ff; border: 1px solid #155e75; border-radius: 8px;
  padding: 8px; font: 12px Segoe UI, sans-serif; min-height: 36px;
}
#picker .moon { text-align: left; cursor: pointer; }
#picker .moon.is-on { border-color: #4ade80; }
#perf { font-size: 11px; color: #93c5fd; margin: 0 0 6px; font-variant-numeric: tabular-nums; }
#perf .warn { color: #f0b429; }
#perf .bad { color: #f07178; }
#peek {
  position: fixed; z-index: 4; width: 260px; pointer-events: none; padding: 10px 12px;
  font-size: 12px; border-radius: 10px;
}
#peek.is-off { display: none; }
#peek .bk { font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: #c8c0e8; }
#peek .t { color: #e8b446; font-weight: 600; }
#fail { position: fixed; z-index: 20; left: 12px; top: 72px; max-width: 36rem; display: none; padding: 16px; }
#claim-slot { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(80,220,255,.18); }
#claim-slot h3.claim-h { margin: 0 0 4px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: #93c5fd; }
#claim-slot .lbl { display: block; color: #7dd3fc; font-size: 11px; margin: 6px 0 3px; }
#claim-slot textarea {
  width: 100%; box-sizing: border-box; min-height: 48px; resize: vertical;
  background: #0b1c2c; color: #e8f4ff; border: 1px solid #155e75; border-radius: 8px; padding: 8px;
}
#claim-slot .pills { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 6px 0; }
#claim-slot .pills button.is-on { border-color: #5ce1ff; color: #5ce1ff; }
#claim-slot .claim-err { color: #fb7185; margin: 4px 0; }
#claim-slot .claim-actions { display: flex; gap: 6px; }
#pose-banner { color: #fde68a; font-size: 11px; margin: 0 0 6px; }
#d-open, .wc-open {
  display: inline-block; margin: 8px 0 0; color: #7dd3fc; font-weight: 600;
}
#d-open[hidden], .wc-open[hidden] { display: none; }
.world-card {
  position: fixed; z-index: 7; width: 250px; height: 158px;
  display: flex; flex-direction: column; overflow: hidden; border-radius: 10px;
  --wc-zoom: 1;
}
.world-card .wc-bar {
  display: flex; align-items: center; gap: 4px; min-height: 32px; padding: 4px 8px;
  cursor: grab; border-bottom: 1px solid rgba(80,220,255,.18);
}
.world-card .wc-head { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #8be9ff; font-weight: 600; font-size: 12px; }
.world-card .wc-tools button {
  min-height: 28px; min-width: 28px; padding: 0 7px; border-radius: 7px; cursor: pointer;
  background: rgba(8,28,44,.4); color: #e8f4ff; border: 1px solid rgba(80,220,255,.35);
}
.world-card .wc-follow.is-on { border-color: #5ce1ff; color: #5ce1ff; }
.world-card .wc-body { flex: 1; overflow: auto; padding: 8px; font-size: calc(12px * var(--wc-zoom)); }
.world-card .wc-kind { color: #a78bfa; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.world-card .wc-what { margin: 4px 0; }
.world-card .wc-grip {
  position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 52%, rgba(80,220,255,.65) 52%);
}
@media (max-width: 720px) {
  #picker { width: min(100vw - 16px, 280px); max-height: 28vh; }
  #desk { width: calc(100vw - 16px); height: 32vh; }
}
