.lobby-return-button {
    --lobby-return-action-size: clamp(50px, 3.4vw, 64px);
    --lobby-return-action-edge: clamp(10px, 0.9vw, 16px);
    --lobby-return-action-top: clamp(10px, 0.8vw, 14px);

    position: fixed;
    top: calc(var(--lobby-return-action-top) + var(--lobby-return-action-size) * 0.98);
    right: calc(var(--lobby-return-action-edge) + 2px);
    z-index: 9998;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: clamp(108px, 7.2vw, 132px);
    min-height: 28px;
    padding: 5px 11px 5px 8px;
    border: 1px solid rgba(125, 221, 213, 0.36);
    border-radius: 999px;
    color: rgba(237, 255, 253, 0.94);
    background:
        linear-gradient(180deg, rgba(174, 255, 249, 0.13), rgba(30, 96, 105, 0.12) 44%, rgba(2, 18, 25, 0.92)),
        radial-gradient(100% 145% at 18% 8%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.03) 28%, transparent 52%),
        linear-gradient(90deg, rgba(2, 16, 24, 0.94), rgba(13, 62, 70, 0.88) 46%, rgba(2, 18, 27, 0.94));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 0 0 1px rgba(185, 255, 249, 0.08),
        inset 0 -7px 12px rgba(1, 10, 16, 0.68),
        0 6px 14px rgba(0, 0, 0, 0.4),
        0 0 9px rgba(54, 205, 196, 0.12);
    cursor: pointer;
    font: 700 clamp(10px, 0.68vw, 12px)/1 Arial, sans-serif;
    letter-spacing: 0;
    text-shadow:
        0 1px 1px rgba(0, 0, 0, 0.9),
        0 0 5px rgba(134, 255, 246, 0.18);
    transition: opacity 160ms ease, transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
    transform: translateZ(0);
}

.lobby-return-button.hidden {
    display: none;
}

.lobby-return-button::before {
    content: "";
    position: absolute;
    inset: 2px 8px auto 31px;
    height: 28%;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0));
    opacity: 0.78;
    pointer-events: none;
}

.lobby-return-button::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 50%;
    width: 23px;
    height: 20px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 45% 44%, rgba(120, 255, 242, 0.14), transparent 46%),
        linear-gradient(135deg, rgba(165, 255, 247, 0.12), rgba(4, 22, 30, 0.46));
    box-shadow:
        inset 0 0 0 1px rgba(155, 255, 247, 0.14),
        inset -6px 0 10px rgba(0, 0, 0, 0.28);
    transform: translateY(-50%);
    pointer-events: none;
}

.lobby-return-button:hover {
    transform: translateY(-1px);
    filter: saturate(1.08) brightness(1.04);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.24),
        inset 0 0 0 1px rgba(196, 255, 249, 0.13),
        inset 0 -7px 12px rgba(1, 10, 16, 0.62),
        0 7px 16px rgba(0, 0, 0, 0.44),
        0 0 13px rgba(74, 232, 220, 0.2);
}

.lobby-return-button:active {
    transform: translateY(1px) scale(0.99);
}

.lobby-return-button:focus-visible {
    outline: 1px solid rgba(255, 238, 161, 0.82);
    outline-offset: 2px;
}

.lobby-return-button__glyph {
    position: relative;
    z-index: 1;
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border: 2px solid rgba(190, 255, 249, 0.82);
    border-right: 0;
    border-bottom: 0;
    transform: rotate(-45deg);
    filter: drop-shadow(0 0 4px rgba(107, 255, 239, 0.42));
}

.lobby-return-button__glyph::after {
    content: "";
    position: absolute;
    left: -2px;
    top: 3px;
    width: 14px;
    height: 2px;
    border-radius: 999px;
    background: rgba(190, 255, 249, 0.82);
}

.lobby-return-button__text {
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

@media (max-width: 680px) {
    .lobby-return-button {
        --lobby-return-action-size: clamp(46px, 11.8vw, 54px);
        --lobby-return-action-edge: max(8px, env(safe-area-inset-right));
        --lobby-return-action-top: max(8px, env(safe-area-inset-top));

        top: calc(var(--lobby-return-action-top) + var(--lobby-return-action-size) * 0.94);
        right: var(--lobby-return-action-edge);
        width: 42px;
        min-height: 30px;
        padding: 0;
        gap: 0;
    }

    .lobby-return-button::before {
        inset: 3px 8px auto 8px;
    }

    .lobby-return-button::after {
        left: 50%;
        width: 26px;
        height: 22px;
        transform: translate(-50%, -50%);
    }

    .lobby-return-button__glyph {
        width: 11px;
        height: 11px;
        flex-basis: 11px;
    }

    .lobby-return-button__glyph::after {
        width: 14px;
        top: 4px;
    }

    .lobby-return-button__text {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}
