:root {
    --bg: #0b1220;
    --pn: #121c2f;
    --tx: #dbe6f5;
    --mu: #7f93ad;
    --cy: #22d3ee;
    --gr: #46506a
}

* {
    box-sizing: border-box
}

html,
body {
    margin: 0;
    height: 100%;
    background: var(--bg);
    color: var(--tx);
    font: 14px system-ui, sans-serif;
    overflow: hidden
}

button {
    font: inherit;
    color: inherit;
    background: #1b2942;
    border: 1px solid #2a3b59;
    border-radius: 8px;
    padding: 4px 10px;
    cursor: pointer
}

button:hover {
    border-color: var(--cy)
}

header {
    height: 52px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    background: var(--pn);
    border-bottom: 1px solid #1e2c46
}

header b {
    color: var(--cy)
}

.sp {
    flex: 1
}

#chip {
    display: flex;
    align-items: center;
    gap: 8px
}

#health {
    display: flex;
    gap: 4px
}

#health i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #555
}

#health i.ok {
    background: #3ddc84
}

#health i.fail {
    background: #ef4444
}

#crumbs {
    height: 34px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    font-size: 13px;
    color: var(--mu);
    overflow: auto;
    white-space: nowrap
}

#crumbs a {
    color: var(--cy);
    cursor: pointer
}

#wrap {
    height: calc(100% - 86px);
    position: relative
}

svg#map {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
    cursor: grab
}

#world path {
    fill: #18283b !important;
    stroke: #2f4863;
    stroke-width: .6
}

#world path.bg {
    fill: none !important;
    stroke: none
}

.rl {
    r: calc(7px*var(--k, 1));
    fill: var(--gr);
    stroke: #0b1220;
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
    cursor: pointer
}

.rl.ing {
    fill: var(--cy);
    animation: p 2s infinite
}

.rl.unk {
    fill: #8b5cf6
}

.rl.foc {
    r: calc(13px*var(--k, 1));
    fill: #fff;
    stroke: var(--cy);
    stroke-width: 3;
    animation: none
}

@keyframes p {
    50% {
        opacity: .45
    }
}

.orbit {
    fill: none;
    stroke: var(--cy);
    stroke-width: 2;
    stroke-dasharray: 6 6;
    vector-effect: non-scaling-stroke;
    transition: cx .8s, cy .8s, r .8s, opacity .4s;
    pointer-events: none
}

.arc {
    fill: none;
    stroke: #facc15;
    stroke-width: 2;
    stroke-dasharray: 10 10;
    vector-effect: non-scaling-stroke;
    animation: f 1s linear infinite;
    pointer-events: none
}

@keyframes f {
    to {
        stroke-dashoffset: -20
    }
}

.lab {
    font-size: calc(13px*var(--k, 1));
    fill: #fff;
    paint-order: stroke;
    stroke: #000;
    stroke-width: 3px;
    pointer-events: none
}

.band {
    fill: #8b5cf6;
    opacity: .08
}

#zoom {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px
}

#tip {
    position: fixed;
    pointer-events: none;
    background: #000c;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    z-index: 5;
    display: none;
    backdrop-filter: blur(4px)
}

#tip i {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    background: #555
}

#tip i.ok {
    background: #3ddc84
}

#modal {
    position: fixed;
    inset: 0;
    background: #0009;
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: opacity .2s
}

#modal.hidden {
    opacity: 0;
    pointer-events: none
}

.card {
    width: min(560px, 94vw);
    max-height: 88vh;
    overflow: auto;
    background: var(--pn);
    border: 1px solid #2a3b59;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 20px 60px #000a;
    transition: transform .2s
}

#modal.hidden .card {
    transform: scale(.94)
}

.card h2 {
    margin: 0 0 8px;
    font-size: 16px;
    word-break: break-all
}

.top {
    display: flex;
    gap: 8px;
    align-items: flex-start
}

.row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
    border-radius: 10px;
    cursor: pointer
}

.row:hover {
    background: #1b2942
}

.row small,
.mu {
    color: var(--mu)
}

.av {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    overflow: hidden;
    color: #fff;
    padding: 0;
    border: 0
}

.av img {
    width: 100%;
    height: 100%;
    object-fit: cover
}

.av.lg {
    width: 72px;
    height: 72px;
    font-size: 24px
}

.badge {
    margin-left: auto;
    background: #1e3a4f;
    color: var(--cy);
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 12px
}

.chip {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    background: #1b2942;
    border-radius: 10px;
    padding: 3px 8px;
    margin: 3px;
    font-size: 12px
}

.chip a {
    color: var(--cy);
    text-decoration: none
}

#gate {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px
}

#gate.hidden {
    display: none
}

#gate div {
    max-width: 440px
}

#toast {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    background: #000d;
    padding: 8px 14px;
    border-radius: 10px;
    z-index: 30;
    display: none
}

@media(max-width:600px) {
    .card {
        width: 100vw;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0
    }
}

.rl {
    r: 5px
}

.rl.foc {
    r: 9px
}

.grat {
    fill: none;
    stroke: #2f4863;
    stroke-width: .5;
    opacity: .5
}

.rim {
    fill: none;
    stroke: #3b82f6;
    stroke-width: 2;
    opacity: .5;
    filter: drop-shadow(0 0 8px #3b82f6)
}

#world path {
    stroke-width: .4
}

.orbit {
    transition: none
}

#unk {
    position: absolute;
    left: 12px;
    bottom: 12px;
    max-width: 260px;
    max-height: 40%;
    overflow: auto;
    display: none;
    background: #000a;
    padding: 8px;
    border-radius: 10px;
    font-size: 12px
}

#unk button {
    display: block;
    margin: 3px 0;
    width: 100%;
    text-align: left
}

#unk button.foc {
    border-color: var(--cy)
}

:root {
    --bg: #05010f;
    --pn: #0a0a1f;
    --cy: #00e5ff;
    --tx: #bfefff;
    --gr: #46506a
}

html,
body {
    background: linear-gradient(#05010f, #0a0020);
    font-family: ui-monospace, 'Cascadia Mono', 'Fira Code', monospace;
    color: var(--tx)
}

header {
    background: #05010fcc;
    border-color: #00e5ff44
}

#map {
    position: relative;
    z-index: 1
}

#bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none
}

#floor {
    position: absolute;
    left: -20%;
    right: -20%;
    bottom: 0;
    height: 40%;
    background: repeating-linear-gradient(90deg, #00e5ff55 0 1px, transparent 1px 60px), repeating-linear-gradient(0deg, #00e5ff55 0 1px, transparent 1px 40px);
    transform: perspective(300px) rotateX(62deg);
    transform-origin: bottom;
    -webkit-mask-image: linear-gradient(transparent, #000);
    mask-image: linear-gradient(transparent, #000);
    opacity: .35;
    pointer-events: none
}

.dust {
    fill: #7df;
    opacity: .25;
    animation: dr linear infinite
}

@keyframes dr {
    to {
        transform: translateY(-120px)
    }
}

#crt {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 40;
    background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 3px), radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .55))
}

#world path {
    fill: #0a0a24cc !important;
    stroke: #00e5ff !important;
    stroke-opacity: .35;
    stroke-width: .4
}

#world path.bg {
    fill: none !important;
    stroke: none !important
}

.grat {
    stroke: #00e5ff;
    stroke-opacity: .25
}

.gratb {
    fill: none;
    stroke: #7a2cff;
    stroke-width: .5;
    opacity: .22
}

.rim {
    stroke: #00e5ff;
    opacity: .4;
    filter: drop-shadow(0 0 8px #00e5ff)
}

.orbit {
    stroke: #ff2d95;
    stroke-width: 2;
    filter: drop-shadow(0 0 5px #ff2d95)
}

.arc {
    stroke: #ff2d95
}

.lab {
    fill: #00e5ff
}

.rl.ing {
    fill: #00e5ff
}

.rl.foc {
    fill: #fff;
    stroke: #00e5ff
}

.rl.sel {
    fill: #ff2d95;
    stroke: #fff;
    r: 8px;
    filter: drop-shadow(0 0 6px #ff2d95);
    animation: none
}

.rl.mg {
    filter: drop-shadow(2px 0 0 #f0f) drop-shadow(-2px 0 0 #0ff)
}

.zap {
    fill: none;
    stroke: #ff2d95;
    stroke-width: 2;
    animation: zp .25s ease-out forwards;
    pointer-events: none
}

@keyframes zp {
    to {
        r: 42px;
        opacity: 0
    }
}

.guide {
    fill: none;
    stroke: #00e5ff;
    stroke-opacity: .18;
    stroke-dasharray: 3 4
}

.pn {
    cursor: pointer
}

.pop {
    animation: pp .3s both;
    transform-box: fill-box;
    transform-origin: center
}

@keyframes pp {
    from {
        opacity: 0;
        transform: scale(.2)
    }
}

.pr {
    fill: none;
    stroke: #555c70;
    stroke-width: 1.5
}

.pr.v {
    stroke: #00ff9c;
    filter: drop-shadow(0 0 3px #00ff9c)
}

.ini {
    fill: #fff;
    font-size: 10px;
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none
}

#zoom {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: row;
    z-index: 7
}

#unk {
    left: 50%;
    transform: translateX(-50%);
    bottom: 56px;
    z-index: 7
}

.hud {
    position: absolute;
    z-index: 6;
    padding: 12px;
    font-size: 12px;
    color: #4fb3c4;
    overflow: auto;
    background: linear-gradient(#00e5ff, #00e5ff) 0 0/14px 2px no-repeat, linear-gradient(#00e5ff, #00e5ff) 0 0/2px 14px no-repeat, linear-gradient(#00e5ff, #00e5ff) 100% 0/14px 2px no-repeat, linear-gradient(#00e5ff, #00e5ff) 100% 0/2px 14px no-repeat, linear-gradient(#00e5ff, #00e5ff) 0 100%/14px 2px no-repeat, linear-gradient(#00e5ff, #00e5ff) 0 100%/2px 14px no-repeat, linear-gradient(#00e5ff, #00e5ff) 100% 100%/14px 2px no-repeat, linear-gradient(#00e5ff, #00e5ff) 100% 100%/2px 14px no-repeat, #05010fb8;
    scrollbar-width: thin
}

.tl {
    left: 10px;
    top: 96px;
    width: 310px;
    max-height: calc(100% - 330px)
}

.tr {
    right: 10px;
    top: 96px;
    width: 250px;
    max-height: 40%
}

.bl {
    left: 10px;
    bottom: 10px;
    width: 210px
}

.br {
    right: 10px;
    bottom: 10px;
    width: 310px;
    max-height: 30%
}

.hh {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #00e5ff;
    letter-spacing: .1em;
    margin-bottom: 8px;
    font-weight: 700
}

.mini {
    padding: 0 6px;
    font-size: 11px;
    background: none;
    border-color: #00e5ff55
}

.kv {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 1px 0
}

.k {
    color: #3a8a99
}

.v {
    color: #00e5ff;
    text-align: right;
    word-break: break-all
}

.v a {
    color: #00e5ff
}

.sec summary {
    cursor: pointer;
    color: #ff2d95;
    margin: 8px 0 3px;
    letter-spacing: .1em
}

.enter {
    animation: sl .3s
}

.enter .sec {
    animation: in .4s both;
    animation-delay: calc(var(--i, 0)*70ms)
}

@keyframes in {
    from {
        opacity: 0;
        transform: translateY(8px)
    }
}

@keyframes sl {
    from {
        opacity: .2;
        transform: translateX(-14px)
    }
}

.rt {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 6px
}

.rt b {
    color: #00e5ff;
    font-size: 14px;
    display: block
}

.ico {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover
}

.desc {
    margin: 4px 0;
    white-space: pre-wrap;
    color: #9fd6e2
}

.bar {
    height: 4px;
    background: #12324a;
    margin: 4px 0
}

.bar i {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #ff2d95, #00e5ff);
    transition: width .9s
}

.badge {
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid
}

.badge.g {
    color: #00ff9c
}

.badge.w {
    color: #ffb020
}

.chip {
    font-size: 10px;
    padding: 1px 5px;
    margin: 2px;
    background: #00e5ff18
}

.ur {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 3px;
    cursor: pointer
}

.ur:hover,
.ur.on {
    background: #00e5ff22
}

.ur small {
    margin-left: auto
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #555;
    flex: none
}

.dot.ok {
    background: #00ff9c;
    animation: p 1.6s infinite
}

#evlog div {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #00e5ff
}

#evlog .sim {
    color: #3a8a99
}

#pal {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: #0008;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 15vh
}

#pal.hidden {
    display: none
}

.pbox {
    width: min(520px, 92vw);
    background: #05010f;
    border: 1px solid #ff2d95;
    box-shadow: 0 0 24px #ff2d9566;
    padding: 10px
}

.pbox input {
    width: 100%;
    background: none;
    border: 0;
    border-bottom: 1px solid #00e5ff55;
    color: #00e5ff;
    font: inherit;
    padding: 8px;
    outline: 0
}

.pr {
    display: flex;
    justify-content: space-between;
    padding: 6px 8px;
    cursor: pointer;
    color: #bfefff
}

.pr.on {
    background: #ff2d9533
}

.pr small {
    color: #3a8a99
}

#map.gl {
    filter: url(#rgb)
}

.card {
    border-color: #00e5ff66;
    box-shadow: 0 0 30px #00e5ff33
}

@media(max-width:760px) {

    .tr,
    .bl,
    .br {
        display: none
    }

    .tl {
        width: min(300px, 72vw);
        max-height: calc(100% - 110px)
    }
}

@media(prefers-reduced-motion:reduce) {

    .dust,
    .pop,
    .enter,
    .enter .sec,
    .rl.ing,
    .dot.ok {
        animation: none
    }
}

.rl.off {
    fill: #ef4444;
    opacity: .6
}

#scan,
#pick {
    padding: 2px 8px
}

#scanbar {
    font-size: 11px;
    padding: 2px 8px;
    border: 1px solid #00e5ff44;
    min-width: 120px;
    text-align: center;
    display: none;
    white-space: nowrap
}

.tr {
    max-height: calc(100% - 370px)
}

.arc {
    stroke-width: 1.6;
    opacity: .9
}

.arc.mine {
    stroke: #00e5ff
}

.arc.both {
    stroke: #00ff9c
}

.arc.friend {
    stroke: #ff2d95;
    stroke-dasharray: 3 7
}

.alab {
    font-size: 11px;
    fill: #fff;
    paint-order: stroke;
    stroke: #000;
    stroke-width: 3px;
    text-anchor: middle;
    pointer-events: none
}

.alab.mine {
    fill: #7df
}

.alab.both {
    fill: #7fffc8
}

.alab.friend {
    fill: #ff8cc6
}

.me {
    fill: #ffe45c;
    stroke: #fff;
    stroke-width: 1.5;
    filter: drop-shadow(0 0 6px #ffe45c)
}

.mering {
    fill: none;
    stroke: #ffe45c;
    stroke-width: 1.5;
    opacity: .6;
    animation: p 1.6s infinite;
    cursor: pointer
}

#tg.on {
    border-color: #ff2d95;
    color: #ff2d95
}

.hh2 {
    color: #ff2d95;
    margin: 10px 0 4px;
    letter-spacing: .1em
}

.ck {
    display: block;
    margin: 3px 0
}

.tg {
    margin-left: 6px
}

.tg.ok {
    color: #00ff9c
}

.tg.add {
    color: #ff2d95
}

.tl {
    max-height: calc(100% - 400px)
}

.cp {
    padding: 0 5px;
    margin-left: 4px;
    font-size: 11px
}

.fg {
    cursor: pointer
}

.fring {
    fill: none;
    stroke: #ff2d95;
    stroke-width: 1.5;
    opacity: .7;
    animation: p 1.6s infinite
}

#unk {
    display: none;
    flex-direction: column;
    resize: both;
    overflow: hidden;
    width: 260px;
    height: 180px;
    min-width: 160px;
    min-height: 90px;
    max-width: 92%;
    max-height: 85%;
    padding: 0;
    background: #05010fcc;
    border: 1px solid #00e5ff55
}

#unk .uh {
    cursor: grab;
    padding: 6px 8px;
    color: #00e5ff;
    border-bottom: 1px solid #00e5ff33;
    user-select: none;
    touch-action: none;
    letter-spacing: .05em
}

#unk .ub {
    flex: 1;
    overflow: auto;
    padding: 6px 8px
}

.rl.v6 {
    fill: none;
    stroke: #8b5cf6;
    stroke-width: 2;
    vector-effect: non-scaling-stroke
}

.rl.v6.ing {
    stroke: #00e5ff
}

.rl.v6.sel {
    stroke: #ff2d95;
    fill: #ff2d9544
}

.cht {
    fill: #bfefff;
    font-size: 11px
}

.cht.dim {
    fill: #7fa6b4
}

#apps {
    position: relative;
    z-index: 60
}

#apps .appbtn {
    display: inline-block;
    padding: 4px 10px;
    cursor: pointer;
    border: 1px solid #00e5ff55;
    border-radius: 8px
}

#apps ul {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin: 6px 0 0;
    padding: 6px;
    list-style: none;
    min-width: 190px;
    background: #05010ff2;
    border: 1px solid #00e5ff66;
    box-shadow: 0 0 24px #00e5ff33;
    border-radius: 10px
}

#apps.open ul {
    display: block
}

#apps li a {
    display: block;
    padding: 6px 10px;
    color: #bfefff;
    text-decoration: none;
    white-space: nowrap;
    border-radius: 6px
}

#apps li a:hover {
    background: #ff2d9533
}

.warn {
    color: #ffb020;
    border: 1px solid #ffb02066;
    background: #ffb02012;
    padding: 6px 8px;
    margin: 6px 0;
    border-radius: 6px
}