.ecn {
    --ecn-bg: #262626;
    --ecn-bg-hover: #303030;
    --ecn-border: rgba(255, 255, 255, .12);
    --ecn-text: #f2f2f2;
    --ecn-pill: rgba(255, 255, 255, .14);
    --ecn-discord: #5865f2;
    --ecn-discord-hover: #4752c4;

    display: flex;
    align-items: center;
    gap: 10px;
    font: 700 13px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    box-sizing: border-box;
}
.ecn *, .ecn *::before, .ecn *::after { box-sizing: border-box; }

/* Desktop: inside the navbar, far right */
.ecn--inline { margin-left: auto; float: right; }
/* Desktop fallback: pinned to the corner */
.ecn--docked { position: fixed; top: 12px; right: 12px; z-index: 1050; }

.ecn__ip, .ecn__join {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 42px;
    padding: 0 8px 0 14px;
    border-radius: 6px;
    color: var(--ecn-text);
    font: inherit;
    letter-spacing: .04em;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .15s ease, transform .1s ease;
}
.ecn__ip {
    background: var(--ecn-bg);
    border: 1px solid var(--ecn-border);
    text-transform: uppercase;
}
.ecn__ip:hover { background: var(--ecn-bg-hover); }
.ecn__join {
    background: var(--ecn-discord);
    border: 1px solid transparent;
    padding-left: 12px;
}
.ecn__join:hover { background: var(--ecn-discord-hover); color: #fff; text-decoration: none; }
.ecn__ip:active, .ecn__join:active { transform: translateY(1px); }

.ecn svg { width: 16px; height: 16px; flex: none; fill: currentColor; }

.ecn__label { overflow: hidden; text-overflow: ellipsis; }
.ecn__pill {
    min-width: 28px;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--ecn-pill);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    text-align: center;
}
.ecn__pill[hidden] { display: none; }
.ecn__join .ecn__text { display: none; }

.ecn__ip:focus-visible, .ecn__join:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Tablet-width desktops: keep the nav from overflowing */
@media (max-width: 1100px) and (min-width: 768px) {
    .ecn__pill { display: none; }
    .ecn__ip, .ecn__join { padding-right: 12px; }
}

/* Mobile: full-width bar at the bottom, thumb-reachable, clear of the hamburger menu */
.ecn--bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1050;
    gap: 8px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    background: rgba(29, 29, 29, .96);
    border-top: 1px solid var(--ecn-border);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    float: none;
}
.ecn--bar .ecn__ip { flex: 1 1 auto; min-width: 0; justify-content: center; height: 46px; font-size: 12px; }
.ecn--bar .ecn__join { flex: 0 0 auto; height: 46px; padding: 0 12px; }
.ecn--bar .ecn__join .ecn__text { display: none; }
@media (max-width: 380px) {
    .ecn--bar .ecn__join .ecn__pill { display: none; }
}
body.ecn-has-bar { padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }

@media (prefers-reduced-motion: reduce) {
    .ecn__ip, .ecn__join { transition: none; }
}
