/* Chat-first layout and guest entry for the public Wall and both private-room systems. */

.wall-guest-nickname-dialog {
    width: min(430px, calc(100vw - 28px));
    max-width: 430px;
    margin: auto;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 22px;
    background: #111219;
    color: #f4f3f6;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(255, 79, 163, 0.05);
}

.wall-guest-nickname-dialog::backdrop {
    background: rgba(3, 4, 8, 0.78);
    backdrop-filter: blur(8px);
}

.wall-guest-nickname-shell {
    padding: 28px;
    background:
        radial-gradient(circle at 90% 0, rgba(123, 97, 255, 0.16), transparent 42%),
        radial-gradient(circle at 0 100%, rgba(255, 79, 163, 0.11), transparent 40%),
        linear-gradient(180deg, rgba(28, 27, 38, 0.98), rgba(13, 14, 21, 0.99));
}

.wall-guest-nickname-kicker {
    margin: 0 0 8px;
    color: #ff86bd;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.13em;
    line-height: 1.2;
    text-transform: uppercase;
}

.wall-guest-nickname-dialog h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(24px, 6vw, 30px);
    letter-spacing: -0.025em;
    line-height: 1.12;
}

.wall-guest-nickname-description {
    margin: 11px 0 22px;
    color: rgba(232, 230, 239, 0.72);
    font-size: 14px;
    line-height: 1.55;
}

.wall-guest-nickname-form,
.wall-guest-nickname-form .form-group {
    display: grid;
    gap: 8px;
}

.wall-guest-nickname-form label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 700;
}

.wall-guest-nickname-form input[type="text"] {
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    border: 1px solid #696b7a;
    border-radius: 12px;
    background: rgba(7, 8, 13, 0.86);
    color: #fff;
    font-size: 16px;
}

.wall-guest-nickname-form input[type="text"]:focus-visible {
    border-color: rgba(255, 79, 163, 0.78);
    outline: 2px solid #ffb4d8;
    outline-offset: 3px;
}

.wall-guest-nickname-lock-note {
    margin: 2px 0 8px;
    color: rgba(211, 211, 223, 0.62);
    font-size: 12px;
    line-height: 1.45;
}

.wall-guest-nickname-submit {
    width: 100%;
    min-height: 46px;
    margin-top: 2px;
}

.wall-mobile-room-actions,
.wall-mobile-room-toolbar,
.member-private-room-live-roster,
.wall-mobile-panel-close,
.wall-mobile-panel-backdrop {
    display: none;
}

@media (max-width: 900px) {
    body.wall-v8-page-lock,
    body.wall-mobile-panel-open {
        overflow: hidden;
    }

    .wall-mobile-room-toolbar {
        grid-area: mobile-toolbar;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        min-width: 0;
        min-height: 42px;
        padding: 3px 4px 3px 12px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 12px;
        background: linear-gradient(180deg, rgba(20, 20, 29, 0.98), rgba(10, 11, 17, 0.98));
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
    }

    .wall-mobile-room-toolbar > strong {
        min-width: 0;
        overflow: hidden;
        color: rgba(255, 255, 255, 0.9);
        font-size: 12px;
        font-weight: 800;
        letter-spacing: 0.02em;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .wall-mobile-room-action,
    .wall-mobile-rules > summary {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        width: 40px;
        min-width: 40px;
        height: 40px;
        min-height: 40px;
        padding: 0;
        border: 1px solid rgba(255, 255, 255, 0.09);
        border-radius: 11px;
        background: rgba(255, 255, 255, 0.035);
        color: rgba(255, 255, 255, 0.88);
        font: inherit;
        font-size: 16px;
        cursor: pointer;
        list-style: none;
    }

    .wall-mobile-room-action:hover,
    .wall-mobile-room-action:focus-visible,
    .wall-mobile-rules > summary:hover,
    .wall-mobile-rules > summary:focus-visible {
        border-color: rgba(255, 79, 163, 0.44);
        background: rgba(255, 79, 163, 0.1);
        outline: none;
    }

    .wall-mobile-room-action:disabled {
        opacity: 0.42;
        cursor: not-allowed;
    }

    .wall-mobile-roster-action {
        gap: 6px;
        width: auto;
        min-width: 48px;
        padding-inline: 9px;
        color: #fff;
        font-size: 12px;
    }

    .wall-mobile-online-dot {
        width: 7px;
        height: 7px;
        border-radius: 999px;
        background: #52e6ad;
        box-shadow: 0 0 0 3px rgba(82, 230, 173, 0.11), 0 0 12px rgba(82, 230, 173, 0.48);
    }

    .wall-mobile-room-actions {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 4px;
    }

    .wall-mobile-rules {
        position: relative;
        flex: 0 0 auto;
    }

    .wall-mobile-rules > summary::-webkit-details-marker {
        display: none;
    }

    .wall-mobile-rules[open] > summary {
        border-color: rgba(255, 79, 163, 0.48);
        background: rgba(255, 79, 163, 0.12);
    }

    .wall-mobile-rules > p {
        position: absolute;
        z-index: 340;
        top: calc(100% + 7px);
        right: -52px;
        width: min(310px, calc(100vw - 24px));
        margin: 0;
        padding: 12px 14px;
        border: 1px solid rgba(255, 79, 163, 0.25);
        border-radius: 13px;
        background: rgba(10, 10, 16, 0.98);
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.48);
        color: rgba(238, 230, 239, 0.8);
        font-size: 11px;
        line-height: 1.45;
    }

    .wall-mobile-room-action .wall-private-chat-unread {
        position: absolute;
        top: -4px;
        right: -4px;
        min-width: 18px;
        height: 18px;
        padding-inline: 4px;
        border: 2px solid #0b0c12;
        border-radius: 999px;
        background: #ff4fa3;
        color: #fff;
        font-size: 9px;
        line-height: 14px;
        text-align: center;
    }

    #wallCommunityPage .wall-v7-main,
    #wallCommunityPage .wall-v7-room,
    #wallCommunityPage #wallCommunityChat,
    #wallCommunityPage #wallCommunityChat .wall-v8-room-shell,
    #wallCommunityPage #wallCommunityChat .wall-v10-timeline-region {
        min-height: 0;
        height: 100%;
    }

    #wallCommunityPage #wallCommunityChat .wall-v8-room-shell {
        grid-template-rows: minmax(0, 1fr) auto;
        max-height: none;
        overflow: hidden;
        border-radius: 13px;
    }

    #wallCommunityPage #wallCommunityChat .wall-v8-timeline-shell {
        height: 100%;
        max-height: none;
        padding: 5px 12px 0 6px;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    #wallCommunityPage #wallCommunityChat .wall-v10-scrollbar {
        right: 3px;
        width: 7px;
    }

    #wallCommunityPage #wallCommunityChat .wall-v8-room-compose {
        gap: 5px;
        padding: 6px;
        border-top-color: rgba(255, 255, 255, 0.075);
        background: rgba(7, 8, 13, 0.99);
    }

    #wallCommunityPage #wallCommunityChat .wall-v8-compose-inline-layout {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 5px;
    }

    #wallCommunityPage #wallCommunityChat .wall-v8-compose-control-rail {
        gap: 8px;
    }

    #wallCommunityPage #wallCommunityChat .wall-v8-compose-control-rail .wall-v8-compose-upload,
    #wallCommunityPage #wallCommunityChat .wall-v8-compose-control-rail .wall-v8-upload-inline,
    #wallCommunityPage #wallCommunityChat .wall-v8-compose-control-rail .wall-v8-compose-actions {
        flex: 0 0 42px;
        width: 42px;
        min-width: 42px;
    }

    #wallCommunityPage #wallCommunityChat .wall-v8-chat-composer .public-chat-v1-input,
    #wallCommunityPage #wallCommunityChat .wall-v8-message-row--guest .wall-v7-chat-nickname input[type="text"] {
        min-height: 42px;
        height: 42px;
        max-height: 42px;
        padding: 9px 12px;
        border-radius: 12px;
        font-size: 16px;
    }

    #wallCommunityPage #wallCommunityChat .wall-v8-message-row,
    #wallCommunityPage #wallCommunityChat .wall-v8-room-compose.is-text-only .wall-v8-message-row {
        grid-template-columns: minmax(0, 1fr) 42px;
        gap: 5px;
        align-items: center;
    }

    #wallCommunityPage #wallCommunityChat .wall-v8-message-row--guest,
    #wallCommunityPage #wallCommunityChat .wall-v8-room-compose.is-text-only .wall-v8-message-row--guest {
        grid-template-columns: minmax(78px, 0.38fr) minmax(0, 1fr) 42px;
    }

    #wallCommunityPage #wallCommunityChat .wall-v8-message-row--guest-upload {
        grid-template-columns: minmax(78px, 0.38fr) minmax(0, 1fr);
    }

    #wallCommunityPage #wallCommunityChat .wall-v8-message-row--guest .wall-v7-chat-nickname {
        grid-column: auto;
        width: auto;
    }

    #wallCommunityPage #wallCommunityChat .wall-v8-send-button,
    #wallCommunityPage #wallCommunityChat .wall-v8-upload-inline .wall-v6-file-trigger {
        width: 42px;
        min-width: 42px;
        min-height: 42px;
        height: 42px;
        border-radius: 12px;
    }

    #wallCommunityPage #wallCommunityChat .wall-v8-send-button::before {
        font-size: 19px;
    }

    #wallCommunityPage #wallCommunityChat .wall-v8-upload-inline .wall-v6-file-name {
        display: none;
    }

    #wallCommunityPage #wallCommunityChat .wall-v8-compose-upload {
        padding: 0;
        border: 0;
        background: transparent;
    }

    #wallCommunityPage #wallCommunityChat .wall-v8-compose-feedback-row {
        gap: 4px;
    }

    #wallCommunityPage #wallCommunityChat .public-chat-v1-feedback:not([hidden]) {
        padding: 5px 8px;
        font-size: 10px;
        line-height: 1.25;
    }

    #wallCommunityPage #wallCommunityChat .wall-v9-stream-entry {
        padding-left: 31px;
    }

    #wallCommunityPage #wallCommunityChat .wall-v9-stream-avatar-shell {
        left: 2px;
    }

    #wallCommunityPage #wallCommunityChat .wall-v9-stream-card {
        padding: 10px 11px !important;
        border-radius: 0 13px 13px 13px !important;
    }

    #wallCommunityPage #wallCommunityChat .wall-v9-stream-card .public-chat-v1-author-row strong {
        font-size: 14px;
    }

    #wallCommunityPage #wallCommunityChat .wall-v9-stream-card .public-chat-v1-message-body,
    #wallCommunityPage #wallCommunityChat .wall-v9-stream-card .public-chat-v1-system-body,
    #wallCommunityPage #wallCommunityChat .wall-v9-stream-card .public-chat-v1-deleted {
        font-size: 13px;
        line-height: 1.45;
    }

    #wallCommunityPage #wallCommunityChat .wall-v6-chat-feed .public-chat-v1-empty {
        margin: auto 0;
        padding: 22px 16px;
        border-color: rgba(255, 255, 255, 0.055);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.012);
    }

    #wallCommunityPage .wall-v7-sidebar {
        position: fixed;
        z-index: 330;
        right: 7px;
        bottom: 7px;
        left: 7px;
        top: auto;
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: auto;
        height: auto;
        min-height: 0;
        max-height: min(78dvh, 650px);
        padding: 46px 9px 9px;
        overflow-x: hidden;
        overflow-y: auto;
        border: 1px solid rgba(255, 255, 255, 0.11);
        border-radius: 22px;
        background: linear-gradient(180deg, rgba(24, 21, 30, 0.99), rgba(8, 9, 14, 0.995));
        box-shadow: 0 26px 80px rgba(0, 0, 0, 0.66);
        transform: translateY(calc(100% + 18px));
        visibility: hidden;
        pointer-events: none;
        transition: transform 190ms ease, visibility 190ms step-end;
    }

    #wallCommunityPage .wall-v7-sidebar.is-mobile-open {
        transform: translateY(0);
        visibility: visible;
        pointer-events: auto;
        transition: transform 190ms ease, visibility 0s step-start;
    }

    #wallCommunityPage .wall-v7-sidebar > * {
        flex: 0 0 auto;
    }

    #wallCommunityPage .wall-v7-sidebar .wall-v7-online-card {
        display: flex;
        flex-direction: column;
        min-height: 180px;
        max-height: 46dvh;
        padding: 12px;
        overflow: hidden;
    }

    #wallCommunityPage .wall-v7-sidebar .wall-v7-online-list {
        min-height: 0;
        max-height: none;
        overflow-y: auto;
    }

    .wall-mobile-panel-close {
        position: absolute;
        z-index: 2;
        top: 8px;
        right: 9px;
        display: grid;
        place-items: center;
        width: 34px;
        height: 34px;
        padding: 0;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 11px;
        background: rgba(255, 255, 255, 0.045);
        color: #fff;
        font: inherit;
        font-size: 22px;
        line-height: 1;
        cursor: pointer;
    }

    .wall-mobile-panel-backdrop {
        position: fixed;
        z-index: 320;
        inset: 0;
        display: block;
        width: 100%;
        height: 100%;
        padding: 0;
        border: 0;
        background: rgba(2, 3, 7, 0.72);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 180ms ease, visibility 180ms step-end;
        backdrop-filter: blur(6px);
    }

    body.wall-mobile-panel-open .wall-mobile-panel-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition: opacity 180ms ease, visibility 0s step-start;
    }

    #wallCommunityPage.private-room-page {
        width: 100%;
        height: 100dvh;
        min-height: 0;
        padding: 6px !important;
    }

    #wallCommunityPage.private-room-page > .wall-v7-layout {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: 42px minmax(0, 1fr);
        grid-template-areas:
            "mobile-toolbar"
            "main";
        gap: 5px;
        height: 100%;
        min-height: 0;
    }

    #wallCommunityPage.private-room-page #wallCommunityChat .wall-v8-room-shell {
        height: 100%;
        min-height: 0;
        max-height: none;
    }

    #wallCommunityPage.member-private-room-live {
        display: grid;
        grid-template-rows: 52px minmax(0, 1fr);
        gap: 4px;
        padding-top: 4px !important;
    }

    #wallCommunityPage.member-private-room-live > .member-private-room-live-head {
        height: 52px;
        min-height: 52px;
        max-height: 52px;
        padding: 3px 2px;
    }

    #wallCommunityPage.member-private-room-live > .wall-v7-layout {
        grid-template-rows: minmax(0, 1fr);
        grid-template-areas: "main";
    }

    #wallCommunityPage.member-private-room-live .private-chatroom-promo--sidebar {
        min-height: 78px;
        max-height: 92px;
    }

    body.public-wall-page .wall-v7-page {
        height: calc(100dvh - 68px);
        min-height: 0;
        padding: 4px 6px 6px !important;
    }

    body.public-wall-page .wall-v7-layout {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: 44px minmax(0, 1fr);
        grid-template-areas:
            "room-picker"
            "main";
        gap: 4px;
        height: 100%;
        min-height: 0;
    }

    body.public-wall-page .wall-v15-room-picker {
        position: relative;
        z-index: 5;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 5px;
        width: 100%;
        min-height: 44px;
        padding: 2px 3px 2px 4px;
        overflow: visible;
        border-radius: 12px;
    }

    body.public-wall-page .wall-v15-room-picker-head {
        display: none;
    }

    body.public-wall-page .wall-v15-room-form,
    body.public-wall-page .wall-v15-room-form select {
        min-width: 0;
        height: 40px;
    }

    body.public-wall-page .wall-v15-room-form select {
        min-height: 40px;
        padding-left: 11px;
        border-radius: 10px;
        font-size: 12px;
    }

    body.public-wall-page #wallCommunityChat .wall-v14-room-rules {
        display: none;
    }

    body.public-wall-page #wallCommunityChat .wall-v8-room-shell {
        height: 100%;
        min-height: 0;
        max-height: none;
    }

    body.public-wall-page .site-footer,
    body.private-room-protection-page .site-footer {
        display: none;
    }
}

@media (max-width: 640px) {
    .wall-guest-nickname-shell {
        padding: 24px 20px 22px;
    }

    body.public-wall-page header.site-header.xs-header {
        padding-top: 4px;
    }

    body.public-wall-page header.site-header.xs-header > .container {
        padding-inline: 6px;
    }

    body.public-wall-page header.site-header.xs-header .xs-header-shell {
        border-radius: 14px;
    }

    body.public-wall-page header.site-header.xs-header .xs-header-bar {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 7px;
        height: 52px;
        min-height: 52px;
        max-height: 52px;
        padding: 6px 7px 6px 12px;
    }

    body.public-wall-page header.site-header.xs-header .private-chatroom-promo,
    body.public-wall-page header.site-header.xs-header .xs-header-summary,
    body.public-wall-page header.site-header.xs-header .header-guest-access,
    body.public-wall-page header.site-header.xs-header .xs-language-switcher {
        display: none;
    }

    body.public-wall-page header.site-header.xs-header .xs-header-brand-cluster {
        width: auto;
        min-width: 0;
    }

    body.public-wall-page header.site-header.xs-header .xs-header-page-title {
        position: static;
        display: block;
        width: auto;
        height: auto;
        min-width: 0;
        margin: 0;
        padding: 0;
        overflow: hidden;
        clip: auto;
        color: rgba(255, 255, 255, 0.94);
        font-size: 15px;
        font-weight: 800;
        letter-spacing: -0.015em;
        line-height: 1.1;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.public-wall-page header.site-header.xs-header .xs-header-bar-right {
        gap: 5px;
    }

    body.public-wall-page header.site-header.xs-header .xs-header-home-cta {
        min-height: 36px;
        padding-inline: 10px;
        border-radius: 10px;
        font-size: 10px;
    }

    body.public-wall-page header.site-header.xs-header .xs-header-toggle {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    body.public-wall-page header.site-header.xs-header .xs-mobile-menu {
        top: 58px;
        right: 6px;
        max-height: calc(100dvh - 64px);
    }

    body.public-wall-page .wall-v7-page {
        height: calc(100dvh - 60px);
    }
}

@media (max-width: 390px) {
    body.public-wall-page header.site-header.xs-header .xs-header-home-cta {
        padding-inline: 8px;
    }

    .wall-mobile-room-action,
    .wall-mobile-rules > summary {
        width: 38px;
        min-width: 38px;
        height: 38px;
        min-height: 38px;
    }

    .wall-mobile-roster-action {
        width: auto;
        min-width: 46px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #wallCommunityPage .wall-v7-sidebar,
    .wall-mobile-panel-backdrop {
        transition: none;
    }
}

/* Keep Home typography aligned with the adjacent guest-account buttons. */
body.public-wall-page header.site-header.xs-header .xs-header-home-cta { font-size: 12px; }
@media (max-width: 760px) {
    body.public-wall-page header.site-header.xs-header .xs-header-home-cta { font-size: 11px; }
}
