/* PMill Lounge — fullscreen booth. Keep body.lounge-immersive chrome rules intact. */

body.lounge-immersive .page-loader,
body.lounge-immersive .cookie-banner,
body.lounge-immersive .sidebar,
body.lounge-immersive .sidebar-overlay,
body.lounge-immersive .site-footer,
body.lounge-immersive .bet-slip,
body.lounge-immersive .bet-slip-toggle {
    display: none !important;
}

body.lounge-immersive .app-layout {
    display: block;
    min-height: calc(100dvh - 64px);
    height: calc(100dvh - 64px);
    overflow: hidden;
}

body.lounge-immersive .navbar-container {
    padding-left: var(--space-md);
}

body.lounge-immersive .main-content {
    padding: 0 !important;
    min-height: 100%;
    height: 100%;
    overflow: hidden;
}

body.lounge-immersive .content-wrapper {
    max-width: none;
    margin: 0;
    height: 100%;
    overflow: hidden;
}

.lounge-page {
    position: relative;
    height: 100%;
    min-height: calc(100dvh - 64px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    isolation: isolate;
    background:
        #070b10;
    color: var(--text-primary);
}

/* Full-bleed cinematic stack: felt glow + vignette + faint scan/grain. Type stays on top. */
.lounge-page::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        rgba(0, 0, 0, 0.22);
}

.lounge-page::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.5;
    background-image:
        rgba(255, 255, 255, 0.022);
    mask-image: rgba(0, 0, 0, 0.5);
}

.lounge-atmosphere {
    pointer-events: none;
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image:
        transparent;
    background-size: 48px 48px, 48px 48px, auto, auto, auto;
    mask-image: rgba(0, 0, 0, 0.6);
    opacity: 0.55;
}

.lounge-topbar {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px 16px;
    padding: 14px 20px 12px;
    flex-shrink: 0;
    flex-wrap: nowrap;
    min-width: 0;
    border-bottom: 1px solid rgba(34, 197, 94, 0.22);
    background:
        rgba(7, 11, 16, 0.82);
    backdrop-filter: blur(14px);
}

.lounge-topbar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: rgba(74, 222, 128, 0.55);
    pointer-events: none;
}

.lounge-kicker {
    margin: 0 0 2px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 0.68rem;
    font-weight: 800;
    color: #4ade80;
    text-shadow: 0 0 18px rgba(34, 197, 94, 0.35);
}

.lounge-brand { min-width: 0; flex: 1 1 auto; }
.lounge-brand h1 {
    margin: 2px 0 0;
    font-size: clamp(1.2rem, 2.4vw, 1.85rem);
    letter-spacing: -0.04em;
    font-weight: 800;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6);
}

.lounge-presence {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex-shrink: 0;
    flex-wrap: nowrap;
    overflow: visible;
}

/* Broadcast pill: LIVE tag + pulsing dot + tabular count. */
.lounge-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #052e16;
    background: #86efac;
    border-radius: 6px;
    padding: 4px 8px;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16), 0 0 22px rgba(34, 197, 94, 0.35);
}

.lounge-presence-count {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(7, 11, 16, 0.72);
    border: 1px solid rgba(34, 197, 94, 0.36);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 0.86rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    white-space: nowrap;
}

.lounge-presence-count strong {
    font-variant-numeric: tabular-nums;
    color: #e6ffef;
}

.lounge-live-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #4ade80;
    flex-shrink: 0;
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
    animation: loungePulse 1.6s ease-out infinite;
}

@keyframes loungePulse {
    0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6), 0 0 12px rgba(74, 222, 128, 0.8); }
    70% { box-shadow: 0 0 0 9px rgba(74, 222, 128, 0), 0 0 12px rgba(74, 222, 128, 0.35); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0), 0 0 8px rgba(74, 222, 128, 0.35); }
}

.lounge-avatars {
    display: flex;
    flex-shrink: 0;
    overflow: visible;
    padding-left: 8px;
}

.lounge-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #22c55e;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #070b10;
    margin-left: -8px;
}

.lounge-avatar:first-child { margin-left: 0; }

.lounge-shell {
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 0;
}

.lounge-chat {
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(48, 54, 61, 0.7);
}

.lounge-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    align-items: stretch;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(34, 197, 94, 0.35) transparent;
}

/* Centered conversation column kills the left-ragged void. */
.lounge-msg,
.lounge-msg-system,
.lounge-loading,
.lounge-empty {
    width: 100%;
    max-width: 42rem;
    margin-inline: auto;
}

.lounge-loading,
.lounge-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 48px 20px;
    font-size: 0.95rem;
    line-height: 1.55;
    background: rgba(7, 11, 16, 0.55);
    border: 1px dashed rgba(74, 222, 128, 0.35);
    border-radius: 18px;
    backdrop-filter: blur(6px);
}

/* Empty state is a dare, not an error. */
.lounge-empty strong {
    display: block;
    color: #f0fdf4;
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    margin-bottom: 8px;
    text-shadow: 0 0 26px rgba(34, 197, 94, 0.4);
}

.lounge-empty::after {
    content: "mic's hot — go first";
    display: inline-block;
    margin-top: 12px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #86efac;
}

.lounge-msg {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: loungeIn 0.22s ease-out;
}

.lounge-msg.is-mine {
    flex-direction: row-reverse;
}

@keyframes loungeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

.lounge-msg-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #238636;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* Packed-room talk: others cooler slate, mine hotter green wash. */
.lounge-msg-bubble {
    position: relative;
    background: rgba(30, 37, 46, 0.94);
    border: 1px solid rgba(63, 74, 86, 0.85);
    border-radius: 16px 16px 16px 6px;
    padding: 8px 13px 10px;
    min-width: 0;
    max-width: min(34rem, 88%);
    flex: 0 1 auto;
    overflow-wrap: break-word;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
}

.lounge-msg.is-mine .lounge-msg-bubble {
    border-radius: 16px 16px 6px 16px;
    background: rgba(34, 197, 94, 0.22);
    border-color: rgba(74, 222, 128, 0.38);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35), 0 0 22px rgba(34, 197, 94, 0.12);
    margin-left: auto;
}

.lounge-msg.is-mine .lounge-msg-avatar {
    background: #16a34a;
    color: #052e16;
}

.lounge-msg-bubble > div:first-child {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 2px;
    min-width: 0;
}
.lounge-msg-name {
    font-weight: 800;
    font-size: 0.8rem;
    letter-spacing: 0.01em;
    color: #e6edf3;
    text-shadow: 0 1px 6px rgba(0,0,0,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.lounge-msg-time {
    font-size: 0.7rem;
    color: #9aa7b4;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
}
.lounge-msg-text { font-size: 0.95rem; line-height: 1.45; word-break: break-word; color: #f0f3f6; }
.lounge-msg-text a { color: #86efac; }
/* Broadcast whisper: centered in the column, legible, not faint. */
.lounge-msg-system {
    align-self: center;
    text-align: center;
    color: #b9c7d2;
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    font-style: normal;
    background: rgba(13, 17, 23, 0.72);
    border: 1px solid rgba(74, 222, 128, 0.22);
    border-radius: 999px;
    padding: 5px 16px;
    max-width: 36rem;
}

/* GIF sits inside the bubble without breaking the stack. */
.lounge-gif {
    display: block;
    width: 100%;
    height: auto;
    max-width: min(280px, 64vw);
    max-height: 220px;
    object-fit: cover;
    border-radius: 12px;
    margin-top: 8px;
    cursor: zoom-in;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #000;
}

/* Tapback-style reactions: overlap the bubble edge like iMessage. */
.lounge-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 7px;
    margin-bottom: -18px;
    position: relative;
    z-index: 1;
    transform: translateY(9px);
}

.lounge-msg { padding-bottom: 8px; }

.lounge-react,
.lounge-react-add {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(10, 14, 19, 0.94);
    color: #f0f3f6;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.lounge-react.is-mine {
    border-color: rgba(34, 197, 94, 0.5);
    background: rgba(34, 197, 94, 0.16);
}

.lounge-react-menu {
    position: relative;
}

.lounge-react-pop {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    padding: 8px;
    background: rgba(10, 14, 19, 0.98);
    border: 1px solid rgba(74, 222, 128, 0.22);
    border-radius: 14px;
    z-index: 5;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    min-width: 16rem;
}

.lounge-react-pop .lounge-react {
    border-radius: 8px;
    min-height: 36px;
    justify-content: center;
    box-shadow: none;
    font-size: 1.15rem;
}

.lounge-preview-note {
    margin: 0 0 8px;
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #7fa88f;
    font-weight: 800;
}

.lounge-dock {
    flex-shrink: 0;
    position: relative;
    z-index: 4;
    border-top: 1px solid rgba(34, 197, 94, 0.24);
    background:
        rgba(17, 23, 30, 0.97);
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -18px 44px rgba(0, 0, 0, 0.45);
}

.lounge-dock > * {
    width: 100%;
    max-width: 42rem;
    margin-inline: auto;
}

.lounge-compose {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.lounge-msg.is-pending .lounge-msg-bubble {
    opacity: 0.78;
}

.lounge-tool,
.lounge-send {
    min-height: 44px;
    border: 0;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
}

.lounge-tool {
    min-width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(33, 38, 45, 0.92);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

.lounge-tool:hover,
.lounge-tool:focus-visible,
.lounge-tool.is-open {
    border-color: rgba(74, 222, 128, 0.5);
    background: rgba(34, 197, 94, 0.16);
    color: #bbf7d0;
    outline: 2px solid rgba(74, 222, 128, 0.35);
    outline-offset: 1px;
}

.lounge-input {
    flex: 1;
    min-width: 0;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(6, 9, 13, 0.92);
    color: var(--text-primary);
    padding: 12px 14px;
    font: inherit;
    line-height: 1.4;
}

.lounge-input:focus {
    outline: none;
    border-color: rgba(74, 222, 128, 0.6);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16), 0 0 24px rgba(34, 197, 94, 0.12);
}

.lounge-input::placeholder { color: #8b949e; }

.lounge-send {
    background: #4ade80;
    color: #052e16;
    padding: 0 20px;
    height: 44px;
    flex-shrink: 0;
    box-shadow: 0 6px 22px rgba(34, 197, 94, 0.28);
}

.lounge-send:hover:not(:disabled) { filter: brightness(1.06); }

.lounge-send:focus-visible {
    outline: 2px solid #bbf7d0;
    outline-offset: 2px;
}

.lounge-send:disabled { opacity: 0.5; cursor: default; }

.lounge-emoji-tray,
.lounge-gif-panel {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: calc(100% + 8px);
    z-index: 8;
    max-width: 42rem;
    margin-inline: auto;
    border: 1px solid rgba(74, 222, 128, 0.22);
    border-radius: 16px;
    background: rgba(10, 14, 19, 0.96);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(16px);
}

.lounge-emoji-tray {
    display: flex;
    gap: 6px;
    padding: 10px;
    flex-wrap: wrap;
}

.lounge-emoji-tray button {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(22, 27, 34, 0.92);
    font-size: 1.2rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lounge-emoji-tray button:hover,
.lounge-emoji-tray button:focus-visible {
    border-color: rgba(74, 222, 128, 0.5);
    outline: 2px solid rgba(74, 222, 128, 0.35);
    outline-offset: 1px;
}

.lounge-gif-panel {
    padding: 10px;
    max-height: min(46vh, 380px);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.lounge-gif-head {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.lounge-gif-search {
    flex: 1;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 8px 10px;
}

.lounge-gif-close {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(22, 27, 34, 0.9);
    color: var(--text-secondary);
    cursor: pointer;
    min-height: 44px;
    padding: 0 14px;
    font-weight: 700;
}

.lounge-stickers {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.lounge-sticker {
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 999px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 0.8rem;
}

.lounge-gif-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 6px;
    overflow-y: auto;
    min-height: 0;
    flex: 1;
}

.lounge-gif-tile {
    display: block;
    padding: 0;
    border: 0;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1;
}

.lounge-gif-tile:hover,
.lounge-gif-tile:focus-visible {
    outline: 2px solid #4ade80;
    outline-offset: 1px;
}

.lounge-gif-grid img,
.lounge-gif-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lounge-gif-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    padding: 18px 8px;
    font-size: 0.85rem;
}

/* Slim velvet-rope bar: same height as the composer, never a slab. */
.lounge-gate {
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 64px;
    padding: 8px 14px calc(8px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(190, 18, 60, 0.45);
    background:
        rgba(24, 10, 16, 0.96);
    background-size: auto, auto;
    background-position: top left, center;
    background-repeat: repeat-x, no-repeat;
    box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.5);
}

.lounge-gate-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 22rem;
}
.lounge-gate-actions .btn,
.lounge-gate-btn {
    flex: 1 1 0;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    font-size: 0.84rem;
    font-weight: 700;
}

.lounge-rail {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    background:
        rgba(7, 11, 16, 0.6);
    border-left: 1px solid rgba(48, 54, 61, 0.5);
}

.lounge-rail-card {
    border: 1px solid rgba(56, 64, 74, 0.85);
    border-radius: 16px;
    padding: 14px 15px;
    background: rgba(26, 32, 40, 0.88);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
}

.lounge-rail-kicker {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.68rem;
    color: #86efac;
    font-weight: 800;
}

.lounge-rail-copy {
    margin: 0 0 10px;
    color: #b9c2cc;
    font-size: 0.86rem;
    line-height: 1.55;
    max-width: 62ch;
    text-wrap: pretty;
}

.lounge-rail-link {
    color: #86efac;
    font-weight: 700;
    font-size: 0.86rem;
}

.lounge-roster {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.88rem;
}

/* People, not a bullet dump. */
.lounge-roster-person,
.lounge-roster > li {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 8px;
    border-radius: 10px;
    min-width: 0;
}
.lounge-roster-person:hover,
.lounge-roster > li:hover { background: rgba(255, 255, 255, 0.03); }
.lounge-roster-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 800;
    color: #eafff1;
    background: #238636;
    border: 1px solid rgba(255, 255, 255, 0.14);
}
.lounge-roster-name {
    font-weight: 600;
    color: #dbe4ec;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.lounge-roster-empty { color: var(--text-muted); }

.lounge-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
}

.lounge-modal[hidden],
.lounge-lightbox[hidden],
.lounge-gif-panel[hidden],
.lounge-emoji-tray[hidden] {
    display: none !important;
}

.lounge-modal-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    max-width: 420px;
    width: 100%;
}

.lounge-modal-card input {
    width: 100%;
    margin: 12px 0;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.lounge-modal-error { color: #f87171; font-size: 0.82rem; }
.lounge-modal-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.lounge-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.86);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2100;
    padding: 24px;
}

.lounge-lightbox img {
    max-width: min(720px, 92vw);
    max-height: 84vh;
    border-radius: 12px;
}

.lounge-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: 0;
    color: #fff;
    cursor: pointer;
}

.lounge-confetti {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1800;
    overflow: hidden;
}

.lounge-confetti i {
    position: absolute;
    top: -10px;
    width: 8px;
    height: 14px;
    animation: loungeFall 1.1s linear forwards;
}

@keyframes loungeFall {
    to { transform: translateY(110vh) rotate(240deg); opacity: 0.2; }
}

@media (max-width: 860px) {
    .lounge-rail { display: none; }
    .lounge-shell { grid-template-columns: minmax(0, 1fr); }
    .lounge-topbar { padding: 10px 12px; gap: 10px; }
    .lounge-brand h1 { font-size: 1.15rem; }
    .lounge-messages { padding: 12px 12px 14px; }
    .lounge-msg,
    .lounge-msg-system,
    .lounge-dock > *,
    .lounge-gif-panel,
    .lounge-emoji-tray,
    .lounge-loading,
    .lounge-empty { max-width: 100%; }
    .lounge-msg-bubble { max-width: min(30rem, 90%); }
    .lounge-gif-panel,
    .lounge-emoji-tray { left: 8px; right: 8px; }
}

/* Composer stays usable at 390px: tight tools, flexible input, no overflow. */
@media (max-width: 480px) {
    .lounge-dock { padding: 8px 8px calc(10px + env(safe-area-inset-bottom, 0px)); }
    .lounge-compose { gap: 6px; }
    .lounge-tool { min-width: 44px; padding: 0 8px; }
    .lounge-send { padding: 0 14px; }
    .lounge-input { padding: 11px 12px; font-size: 16px; }
    .lounge-presence { gap: 8px; }
    .lounge-presence-count { padding: 6px 10px; font-size: 0.8rem; }
    .lounge-avatars { display: none; }
    .lounge-gate {
        min-height: 56px;
        padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
    }
    .lounge-gate-actions { max-width: none; gap: 8px; }
}

.lounge-react .lounge-react-emoji {
    font-size: 1.05rem;
    line-height: 1;
}

.lounge-date-sep {
    width: 100%;
    max-width: 42rem;
    margin: 14px auto 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #8b949e;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.lounge-date-sep::before,
.lounge-date-sep::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.lounge-date-sep span {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(13, 17, 23, 0.65);
}

.lounge-msg.is-compact .lounge-msg-avatar {
    visibility: hidden;
}

.lounge-msg.is-compact .lounge-msg-bubble > div:first-child {
    display: none;
}

.lounge-typing {
    margin: 0 0 6px;
    min-height: 1.1rem;
    font-size: 0.78rem;
    color: #86efac;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.lounge-emoji-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.22);
}

.lounge-emoji-tabs button {
    flex: 1;
    min-height: 40px;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.65;
}

.lounge-emoji-tabs button.is-active,
.lounge-emoji-tabs button:hover {
    opacity: 1;
    background: rgba(34, 197, 94, 0.18);
}

.lounge-emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    padding: 10px;
    max-height: 220px;
    overflow-y: auto;
}

.lounge-emoji-grid button {
    width: 100%;
    aspect-ratio: 1;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font-size: 1.25rem;
    cursor: pointer;
}

.lounge-emoji-grid button:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.08);
}

@media (max-width: 480px) {
    .lounge-emoji-grid { grid-template-columns: repeat(7, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    .lounge-live-dot { animation: none; }
    .lounge-msg { animation: none; }
    .lounge-messages { scroll-behavior: auto; }
    .lounge-page::after { display: none; }
}

/* Muse pass 3 — streaming chat dock. Single tight bar, overlay pickers above. */

.lounge-compose {
    align-items: center;
    background: rgba(13, 18, 24, 0.92);
    border: 1px solid rgba(63, 74, 86, 0.7);
    border-radius: 16px;
    padding: 6px;
}

.lounge-compose:focus-within {
    border-color: rgba(74, 222, 128, 0.45);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
}

.lounge-input {
    border-color: transparent;
    background: transparent;
    border-radius: 10px;
    padding: 10px 10px;
}

.lounge-input:focus {
    border-color: transparent;
    box-shadow: none;
}

.lounge-input::placeholder { color: #a7b3bf; opacity: 1; }

.lounge-tool {
    border-color: transparent;
    background: rgba(255, 255, 255, 0.05);
    color: #c3ced8;
    border-radius: 11px;
    font-size: 0.72rem;
}

.lounge-send { border-radius: 11px; }

.lounge-emoji-tray,
.lounge-gif-panel {
    position: absolute;
    bottom: 100%;
    margin-bottom: 8px;
    max-height: min(52dvh, 380px);
    overflow: hidden;
}

.lounge-emoji-tray {
    overflow-y: auto;
    align-content: flex-start;
}

.lounge-gif-panel { overflow: hidden; }

.lounge-gif-grid {
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    scrollbar-width: thin;
    scrollbar-color: rgba(34, 197, 94, 0.3) transparent;
}

.lounge-gif-tile {
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.lounge-stickers {
    gap: 6px;
    padding-bottom: 8px;
    scrollbar-width: none;
}

.lounge-stickers::-webkit-scrollbar { display: none; }

.lounge-sticker {
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.04);
    color: #9aa7b4;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    min-height: 32px;
}

.lounge-sticker:hover,
.lounge-sticker:focus-visible,
.lounge-sticker.is-active {
    color: #bbf7d0;
    border-color: rgba(74, 222, 128, 0.45);
    background: rgba(34, 197, 94, 0.14);
    outline: none;
}

.lounge-gif-empty {
    color: #7d8b98;
    font-size: 0.82rem;
    padding: 20px 8px;
}

.lounge-msg.is-mine { justify-content: flex-end; }

.lounge-msg.is-pending .lounge-msg-bubble {
    opacity: 0.72;
    filter: saturate(0.85);
}

/* Muse pass 4 — final QA polish. Resolves pass-3/base cascade conflicts.
   Stacking scale: thread (auto) < react-pop (20) < dock (30) < pickers (40).
   Base + pass-3 blocks above are left intact; this block is the single source of truth. */

.lounge-dock { z-index: 30; }

.lounge-emoji-tray,
.lounge-gif-panel {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: calc(100% + 8px);
    z-index: 40;
    max-width: 42rem;
    margin-inline: auto;
    margin-bottom: 0;
    max-height: min(52dvh, 380px);
    overflow: hidden;
    border: 1px solid rgba(74, 222, 128, 0.22);
    border-radius: 16px;
    background: rgba(10, 14, 19, 0.96);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(16px);
}

/* Emoji tray is a stacked card (tabs on top, grid below), not a flex-wrap tray. */
.lounge-emoji-tray {
    display: block;
    padding: 0;
    overflow-y: auto;
}

.lounge-emoji-tabs {
    position: sticky;
    top: 0;
    z-index: 1;
}

.lounge-emoji-grid button {
    min-height: 44px;
}

.lounge-emoji-grid button:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.08);
}

.lounge-emoji-grid button:focus-visible,
.lounge-emoji-tabs button:focus-visible,
.lounge-gif-tile:focus-visible,
.lounge-sticker:focus-visible,
.lounge-gif-close:focus-visible,
.lounge-gif-search:focus-visible,
.lounge-react:focus-visible,
.lounge-react-add:focus-visible {
    outline: 2px solid rgba(74, 222, 128, 0.65);
    outline-offset: 2px;
}

/* Single tight composer bar. */
.lounge-compose {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(13, 18, 24, 0.92);
    border: 1px solid rgba(63, 74, 86, 0.7);
    border-radius: 16px;
    padding: 6px;
}

.lounge-compose:focus-within {
    border-color: rgba(74, 222, 128, 0.45);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
}

.lounge-input {
    flex: 1;
    min-width: 0;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--text-primary);
    padding: 10px;
    font: inherit;
    line-height: 1.4;
}

.lounge-input:focus { outline: none; }

.lounge-input:focus-visible {
    outline: 2px solid rgba(74, 222, 128, 0.55);
    outline-offset: 1px;
}

.lounge-input::placeholder { color: #a7b3bf; opacity: 1; }

.lounge-tool {
    min-width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    color: #c3ced8;
    border: 1px solid transparent;
    border-radius: 11px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    cursor: pointer;
}

.lounge-tool:hover,
.lounge-tool.is-open {
    border-color: rgba(74, 222, 128, 0.5);
    background: rgba(34, 197, 94, 0.16);
    color: #bbf7d0;
}

.lounge-tool:focus-visible {
    outline: 2px solid rgba(74, 222, 128, 0.65);
    outline-offset: 2px;
    border-color: rgba(74, 222, 128, 0.5);
    background: rgba(34, 197, 94, 0.16);
    color: #bbf7d0;
}

.lounge-send { border-radius: 11px; }

.lounge-send:focus-visible {
    outline: 2px solid #bbf7d0;
    outline-offset: 2px;
}

/* Reactions sit in one quiet row; pills vertically centered. */
.lounge-reactions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-top: 7px;
    margin-bottom: -18px;
    position: relative;
    z-index: 1;
    transform: translateY(9px);
}

.lounge-msg { padding-bottom: 8px; }

.lounge-msg.is-mine { justify-content: flex-end; }

.lounge-msg.is-pending .lounge-msg-bubble {
    opacity: 0.72;
    filter: saturate(0.85);
}

/* Reaction picker floats above the bubble, never under the dock/pickers. */
.lounge-react-pop {
    z-index: 20;
    min-width: 16rem;
    max-width: min(18rem, calc(100vw - 48px));
}

/* Mine-side bubbles open the picker against the right edge so it can't clip left off-screen. */
.lounge-msg.is-mine .lounge-react-pop {
    left: auto;
    right: 0;
}

/* Tighter follow-ups from the same person. */
.lounge-msg.is-compact { margin-top: -5px; }

.lounge-msg.is-compact .lounge-msg-avatar { visibility: hidden; }

.lounge-msg.is-compact .lounge-msg-bubble > div:first-child { display: none; }

/* Quiet thread furniture: date separators, system lines, typing. */
.lounge-date-sep {
    color: #7d8b98;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    line-height: 1.4;
}

.lounge-msg-system {
    color: #a9b7c3;
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    line-height: 1.45;
}

.lounge-typing {
    color: #7ddba0;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.4;
}

/* GIF dock grid stays dense and quiet. */
.lounge-gif-grid {
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    scrollbar-width: thin;
    scrollbar-color: rgba(34, 197, 94, 0.3) transparent;
}

.lounge-gif-tile {
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.lounge-stickers { scrollbar-width: none; }

.lounge-stickers::-webkit-scrollbar { display: none; }

.lounge-sticker {
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.04);
    color: #9aa7b4;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    min-height: 32px;
}

.lounge-sticker:hover,
.lounge-sticker.is-active {
    color: #bbf7d0;
    border-color: rgba(74, 222, 128, 0.45);
    background: rgba(34, 197, 94, 0.14);
}

.lounge-gif-empty {
    color: #7d8b98;
    font-size: 0.82rem;
    padding: 20px 8px;
}

/* 390px: one-line ellipsis title, hidden rail/avatars, usable pickers, unclipped composer. */
@media (max-width: 480px) {
    .lounge-brand { min-width: 0; }
    .lounge-kicker { font-size: 0.6rem; letter-spacing: 0.18em; }
    .lounge-brand h1 {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 1.05rem;
    }
    .lounge-live-pill { padding: 3px 7px; }
    .lounge-dock { padding: 8px 8px calc(10px + env(safe-area-inset-bottom, 0px)); }
    .lounge-compose { gap: 6px; border-radius: 14px; }
    .lounge-tool { min-width: 44px; padding: 0 8px; }
    .lounge-send { padding: 0 14px; }
    .lounge-input { padding: 11px 12px; font-size: 16px; }
    .lounge-presence { gap: 8px; }
    .lounge-presence-count { padding: 6px 10px; font-size: 0.8rem; }
    .lounge-avatars { display: none; }
    .lounge-emoji-tray,
    .lounge-gif-panel {
        left: 8px;
        right: 8px;
        bottom: calc(100% + 8px);
        max-height: 52dvh;
    }
    .lounge-gif-grid { grid-template-columns: repeat(3, 1fr); }
    .lounge-emoji-grid { grid-template-columns: repeat(7, 1fr); }
    .lounge-react-pop {
        grid-template-columns: repeat(6, 1fr);
        min-width: 0;
        max-width: calc(100vw - 32px);
    }
}

/* Muse pass 5 — WhopsApp-style rows, PMill green, single-server chat */
body.lounge-pass5 .lounge-page { background: #0d1117; }
body.lounge-pass5 .lounge-atmosphere,
body.lounge-pass5 .lounge-page::before,
body.lounge-pass5 .lounge-page::after { opacity: 0.35; }
body.lounge-pass5 .lounge-topbar {
    background: rgba(13, 17, 23, 0.92);
    border-bottom: 1px solid rgba(48, 54, 61, 0.9);
    backdrop-filter: blur(10px);
}
body.lounge-pass5 .lounge-channel-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 20px 10px;
    border-bottom: 1px solid rgba(48, 54, 61, 0.65);
    flex-shrink: 0;
    background: rgba(13, 17, 23, 0.6);
}
body.lounge-pass5 .lounge-channel-hash {
    font-size: 1.35rem;
    font-weight: 700;
    color: #6e7681;
    line-height: 1.2;
    margin-top: 2px;
}
body.lounge-pass5 .lounge-channel-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #e6edf3;
}
body.lounge-pass5 .lounge-channel-desc {
    margin: 4px 0 0;
    font-size: 0.78rem;
    color: #8b949e;
}
body.lounge-pass5 .lounge-messages {
    padding: 8px 12px 16px;
    gap: 2px;
    background: #0d1117;
}
body.lounge-pass5 .lounge-msg {
    flex-direction: row;
    gap: 12px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: background 0.15s ease;
}
body.lounge-pass5 .lounge-msg:hover {
    background: rgba(34, 197, 94, 0.08);
}
body.lounge-pass5 .lounge-msg.is-mine {
    flex-direction: row;
    background: rgba(34, 197, 94, 0.06);
}
body.lounge-pass5 .lounge-msg-avatar,
body.lounge-pass5 .lounge-msg-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(48, 54, 61, 0.9);
}
body.lounge-pass5 .lounge-msg-body { flex: 1; min-width: 0; }
body.lounge-pass5 .lounge-msg-meta {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 2px;
}
body.lounge-pass5 .lounge-msg-name { font-size: 0.875rem; font-weight: 700; color: #e6edf3; }
body.lounge-pass5 .lounge-msg-time { font-size: 0.72rem; color: #6e7681; margin-left: 0; }
body.lounge-pass5 .lounge-msg-text { font-size: 0.9375rem; line-height: 1.5; color: #c9d1d9; }
body.lounge-pass5 .lounge-msg.is-compact .lounge-msg-meta,
body.lounge-pass5 .lounge-msg.is-compact .lounge-msg-avatar,
body.lounge-pass5 .lounge-msg.is-compact .lounge-msg-avatar-img {
    visibility: hidden;
    height: 0;
    width: 0;
    overflow: hidden;
}
body.lounge-pass5 .lounge-msg.is-compact .lounge-msg-body { margin-left: 52px; }
body.lounge-pass5 .lounge-avatar-has-img { padding: 0; overflow: hidden; background: #21262d; }
body.lounge-pass5 .lounge-avatar-has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
body.lounge-pass5 .lounge-roster-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
body.lounge-pass5 .lounge-dock { background: #161b22; border-top: 1px solid rgba(48, 54, 61, 0.9); }
body.lounge-pass5 .lounge-compose { background: #21262d; border: 1px solid rgba(48, 54, 61, 0.95); }
body.lounge-pass5 .lounge-input { background: transparent; color: #e6edf3; }
body.lounge-pass5 .lounge-send {
    background: #22c55e;
    color: #052e16;
    font-weight: 700;
}
@media (max-width: 480px) {
    body.lounge-pass5 .lounge-channel-desc { display: none; }
    body.lounge-pass5 .lounge-msg.is-compact .lounge-msg-body { margin-left: 0; }
}

/* Muse pass 6 — emoji GIF filters, plain empty state */
body.lounge-pass5 .lounge-sticker {
    font-size: 1.15rem;
    padding: 8px 11px;
    min-width: 44px;
    min-height: 44px;
    border-color: rgba(48, 54, 61, 0.9);
    background: rgba(33, 38, 45, 0.95);
}
body.lounge-pass5 .lounge-sticker:hover,
body.lounge-pass5 .lounge-sticker.is-active {
    border-color: rgba(74, 222, 128, 0.45);
    background: rgba(34, 197, 94, 0.12);
}
body.lounge-pass5 .lounge-empty::after {
    content: "Say hello when you're ready";
    text-transform: none;
    letter-spacing: 0.02em;
    font-weight: 600;
    font-size: 0.8rem;
    color: #8b949e;
}
body.lounge-pass5 .lounge-empty strong {
    text-transform: none;
    text-shadow: none;
    font-size: 1.15rem;
}

/* Muse pass 7 — fix reactions overlap, picker, errors */
body.lounge-pass5 .lounge-reactions {
    margin-top: 8px;
    margin-bottom: 0;
    transform: none;
    padding-top: 2px;
}
body.lounge-pass5 .lounge-msg {
    padding-bottom: 14px;
    margin-bottom: 2px;
}
body.lounge-pass5 .lounge-msg-body {
    position: relative;
}
body.lounge-pass5 .lounge-msg.is-compact .lounge-msg-meta {
    display: none;
}
body.lounge-pass5 .lounge-msg.is-compact .lounge-msg-avatar,
body.lounge-pass5 .lounge-msg.is-compact .lounge-msg-avatar-img {
    visibility: hidden;
    width: 0;
    height: 0;
    margin: 0;
}
body.lounge-pass5 .lounge-msg.is-compact .lounge-msg-body {
    margin-left: 52px;
}
body.lounge-pass5 .lounge-react-pop {
    position: absolute;
    left: 0;
    bottom: calc(100% + 4px);
    z-index: 25;
}
body.lounge-pass5 .lounge-react-menu {
    position: static;
}
.lounge-send-error {
    margin: 0 0 8px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 0.82rem;
    color: #fecaca;
    background: rgba(127, 29, 29, 0.35);
    border: 1px solid rgba(248, 113, 113, 0.35);
}
.lounge-msg.is-failed .lounge-msg-body {
    opacity: 0.55;
}

.lounge-holder-gate {
    margin: 0 0 10px;
    padding: 12px 12px 10px;
    border-radius: 12px;
    border: 1px solid rgba(74, 222, 128, 0.28);
    background: rgba(22, 27, 34, 0.92);
}
.lounge-holder-copy {
    margin: 0 0 10px;
    color: #e6edf3;
    font-size: 0.88rem;
    line-height: 1.45;
}
.lounge-holder-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.lounge-holder-note {
    margin: 8px 0 0;
    font-size: 0.78rem;
    color: #8b949e;
}

/* Muse pass 8 — night-game sports lounge / clubhouse.
   Overrides pass-5 Slack flatten with CSS-only atmosphere. Keeps
   body.lounge-immersive chrome rules, IDs/data-attrs, pass-7 reaction layout. */

/* 1. Atmosphere — floodlight, tungsten, felt, vignette (beats pass-5 opacity:0.35). */
body.lounge-pass5 .lounge-page {
    background:
        #16110a;
}
body.lounge-pass5 .lounge-page::before {
    opacity: 1;
    background:
        rgba(255, 209, 130, 0.08);
}
body.lounge-pass5 .lounge-page::after {
    opacity: 0.5;
    background-image:
        rgba(255, 236, 200, 0.014);
    mask-image: rgba(0, 0, 0, 0.55);
}
body.lounge-pass5 .lounge-atmosphere {
    opacity: 1;
    background-image:
        transparent;
    background-size: auto, auto, auto, 52px 52px, 52px 52px, auto;
    mask-image: rgba(0, 0, 0, 0.75);
}

/* 2. Scoreboard topbar — broadcast bug, jersey tickertape, brass hairline. */
body.lounge-pass5 .lounge-topbar {
    padding-top: 17px;
    background:
        rgba(28, 21, 11, 0.92);
    border-bottom: 1px solid rgba(212, 175, 55, 0.30);
    backdrop-filter: blur(12px);
}
body.lounge-pass5 .lounge-topbar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #22c55e;
    opacity: 0.85;
    pointer-events: none;
}
body.lounge-pass5 .lounge-topbar::after {
    background: rgba(212, 175, 55, 0.65);
}
body.lounge-pass5 .lounge-kicker {
    color: #e9c46a;
    text-shadow: 0 0 16px rgba(233, 196, 106, 0.30);
}
body.lounge-pass5 .lounge-brand h1 {
    color: #f7f1e3;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.65), 0 0 26px rgba(34, 197, 94, 0.18);
}
body.lounge-pass5 .lounge-presence-count {
    background: rgba(4, 7, 5, 0.85);
    border: 1px solid rgba(212, 175, 55, 0.38);
    box-shadow: inset 0 1px 0 rgba(255, 235, 190, 0.10), 0 0 18px rgba(0, 0, 0, 0.5);
}
body.lounge-pass5 .lounge-presence-count strong { color: #fdf6e3; }
body.lounge-pass5 .lounge-presence-count #loungeInRoomLabel { color: #cbbd9c; }
body.lounge-pass5 .lounge-live-pill {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18), 0 0 22px rgba(34, 197, 94, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* Channel head — clubhouse plaque, brass ticket hash. */
body.lounge-pass5 .lounge-channel-head {
    background: rgba(32, 24, 13, 0.55);
    border-bottom: 1px solid rgba(212, 175, 55, 0.18);
}
body.lounge-pass5 .lounge-channel-hash {
    color: #0b120d;
    background: #e9c46a;
    border-radius: 8px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    margin-top: 1px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
body.lounge-pass5 .lounge-channel-title { color: #f5eedd; letter-spacing: -0.02em; }
body.lounge-pass5 .lounge-channel-desc { color: #c8bfa9; }

/* 3. Chat surface — lifted felt booth-back pane, centered column. */
body.lounge-pass5 .lounge-chat { background: transparent; }
body.lounge-pass5 .lounge-messages {
    background: transparent;
    padding: 14px 16px 20px;
    gap: 4px;
    scrollbar-color: rgba(233, 196, 106, 0.35) transparent;
}
body.lounge-pass5 .lounge-msg {
    width: 100%;
    max-width: 44rem;
    margin-inline: auto;
    background: rgba(24, 30, 26, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(6px);
}
body.lounge-pass5 .lounge-msg:hover {
    background: rgba(32, 40, 32, 0.88);
    border-color: rgba(212, 175, 55, 0.22);
}
body.lounge-pass5 .lounge-msg.is-mine {
    background: rgba(34, 197, 94, 0.14);
    border-color: rgba(74, 222, 128, 0.28);
}
body.lounge-pass5 .lounge-msg-text { color: #e9eef2; }
body.lounge-pass5 .lounge-msg-name { color: #f2ecdc; }
body.lounge-pass5 .lounge-msg-time { color: #a99e83; }
body.lounge-pass5 .lounge-date-sep { color: #b3a888; }
body.lounge-pass5 .lounge-date-sep::before,
body.lounge-pass5 .lounge-date-sep::after { background: rgba(212, 175, 55, 0.22); }
body.lounge-pass5 .lounge-date-sep span {
    border-color: rgba(212, 175, 55, 0.30);
    background: rgba(20, 16, 9, 0.80);
    color: #e9dcae;
}
body.lounge-pass5 .lounge-msg-system {
    background: rgba(18, 15, 8, 0.82);
    border-color: rgba(212, 175, 55, 0.28);
    color: #d8cdb2;
}

/* 4. Guest gate — sports-lounge door: dark green felt + brass ticket stub. */
body.lounge-pass5 .lounge-gate,
.lounge-gate {
    position: sticky;
    border-top: 1px solid rgba(212, 175, 55, 0.50);
    background:
        rgba(21, 46, 30, 0.97);
    box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 235, 190, 0.10);
}
body.lounge-pass5 .lounge-gate::before,
.lounge-gate::before {
    content: "";
    position: absolute;
    left: 24px;
    top: 8px;
    bottom: 8px;
    width: 0;
    border-left: 2px dashed rgba(233, 196, 106, 0.38);
    pointer-events: none;
}
body.lounge-pass5 .lounge-gate-actions .btn-primary,
body.lounge-pass5 .lounge-gate-btn {
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Holder gate — ticket stub, not software card. */
body.lounge-pass5 .lounge-holder-gate {
    background: rgba(20, 42, 28, 0.95);
    border: 1px dashed rgba(233, 196, 106, 0.50);
    box-shadow: inset 0 1px 0 rgba(255, 235, 190, 0.08);
}
body.lounge-pass5 .lounge-holder-copy { color: #efe6cd; }
body.lounge-pass5 .lounge-holder-note { color: #b3a888; }

/* 5. Rail — dark-wood clubhouse card. */
body.lounge-pass5 .lounge-rail {
    background:
        rgba(28, 21, 12, 0.55);
    border-left: 1px solid rgba(212, 175, 55, 0.20);
}
body.lounge-pass5 .lounge-rail-card {
    background: #221a0f;
    border: 1px solid rgba(212, 175, 55, 0.24);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 235, 190, 0.08);
}
body.lounge-pass5 .lounge-rail-kicker { color: #e9c46a; }
body.lounge-pass5 .lounge-rail-copy { color: #cfc6b2; }
body.lounge-pass5 .lounge-roster-name { color: #efe7d3; }
body.lounge-pass5 .lounge-roster-person:hover,
body.lounge-pass5 .lounge-roster > li:hover { background: rgba(233, 196, 106, 0.07); }
body.lounge-pass5 .lounge-rail-link { color: #8fe3ab; }

/* 6. Empty / sparse thread — room with the lights on. */
body.lounge-pass5 .lounge-empty,
body.lounge-pass5 .lounge-loading {
    width: 100%;
    max-width: 44rem;
    margin-inline: auto;
    background:
        rgba(26, 32, 26, 0.88);
    border: 1px dashed rgba(233, 196, 106, 0.45);
    color: #cfc6b2;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 235, 190, 0.08);
}
body.lounge-pass5 .lounge-empty strong {
    color: #f7f0dd;
    text-shadow: 0 0 24px rgba(255, 200, 120, 0.25);
}
body.lounge-pass5 .lounge-empty::after {
    content: "The lamps are on — pull up a seat and say hello";
    text-transform: none;
    letter-spacing: 0.02em;
    font-weight: 600;
    font-size: 0.8rem;
    color: #d9bd7d;
}

/* Tungsten pool near the compose dock. */
body.lounge-pass5 .lounge-dock {
    background:
        rgba(13, 17, 13, 0.96);
    border-top: 1px solid rgba(212, 175, 55, 0.32);
    box-shadow: 0 -22px 50px rgba(0, 0, 0, 0.55);
}
body.lounge-pass5 .lounge-compose {
    background: rgba(14, 19, 15, 0.94);
    border: 1px solid rgba(212, 175, 55, 0.22);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 235, 190, 0.06);
}
body.lounge-pass5 .lounge-compose:focus-within {
    border-color: rgba(74, 222, 128, 0.55);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16), 0 0 28px rgba(255, 190, 100, 0.10);
}
body.lounge-pass5 .lounge-typing { color: #d9bd7d; }

/* 7. Mobile (~390px) — simplify atmosphere, keep gate + compose usable. */
@media (max-width: 480px) {
    body.lounge-pass5 .lounge-page::after { opacity: 0.25; }
    body.lounge-pass5 .lounge-atmosphere { opacity: 0.7; }
    body.lounge-pass5 .lounge-topbar { padding-top: 15px; }
    body.lounge-pass5 .lounge-channel-head { padding: 10px 12px 9px; }
    body.lounge-pass5 .lounge-messages { padding: 10px 10px 16px; }
    body.lounge-pass5 .lounge-msg { border-radius: 10px; }
    body.lounge-pass5 .lounge-gate::before,
    .lounge-gate::before { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    body.lounge-pass5 .lounge-page::before,
    body.lounge-pass5 .lounge-page::after,
    body.lounge-pass5 .lounge-atmosphere { mask-image: none; }
}

.lounge-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 4px 8px;
    max-width: 100%;
}
.lounge-chip {
    border: 1px solid rgba(48, 54, 61, 0.95);
    background: rgba(33, 38, 45, 0.85);
    color: #c9d1d9;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.lounge-chip:hover,
.lounge-chip:focus-visible {
    border-color: rgba(74, 222, 128, 0.55);
    background: rgba(34, 197, 94, 0.12);
    outline: none;
}
body.lounge-pass5 .lounge-chip {
    border-color: rgba(212, 168, 83, 0.25);
    background: rgba(22, 27, 34, 0.9);
}
body.lounge-pass5 .lounge-chip:hover {
    border-color: rgba(74, 222, 128, 0.45);
}

/* Grid children must be allowed to shrink below their content size, otherwise
   the chat column (and its composer) overflow narrow viewports. */
.lounge-shell > * { min-width: 0; }
.lounge-chat, .lounge-dock, .lounge-compose { min-width: 0; max-width: 100%; }
.lounge-messages { overflow-wrap: anywhere; }

/* Phone topbar: kicker chip + title + LIVE pill + avatars on ONE tidy row (beats the stacked
   kicker/h1 rules above; appended last on purpose). */
@media (max-width: 480px) {
    .lounge-topbar,
    body.lounge-pass5 .lounge-topbar {
        padding: 12px 12px 9px;
        gap: 8px;
        align-items: center;
    }
    .lounge-brand {
        display: flex;
        align-items: center;
        gap: 7px;
        min-width: 0;
        flex: 1 1 auto;
    }
    .lounge-kicker,
    body.lounge-pass5 .lounge-kicker {
        margin: 0;
        flex-shrink: 0;
        font-size: 0.54rem;
        letter-spacing: 0.14em;
        line-height: 1;
        padding: 4px 6px;
        border-radius: 5px;
        background: rgba(233, 196, 106, 0.14);
        border: 1px solid rgba(233, 196, 106, 0.32);
        text-shadow: none;
    }
    .lounge-brand h1,
    body.lounge-pass5 .lounge-brand h1 {
        margin: 0;
        font-size: 1rem;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
    }
    .lounge-presence { gap: 6px; flex-shrink: 0; }
    .lounge-presence-count,
    body.lounge-pass5 .lounge-presence-count { padding: 4px 8px 4px 5px; gap: 5px; font-size: 0.74rem; }
    .lounge-live-pill,
    body.lounge-pass5 .lounge-live-pill { padding: 3px 6px; font-size: 0.58rem; letter-spacing: 0.12em; }
    .lounge-live-dot { width: 7px; height: 7px; }
    .lounge-avatars { display: flex; padding-left: 4px; }
    .lounge-avatar { width: 24px; height: 24px; font-size: 0.6rem; margin-left: -7px; }
    .lounge-avatar:nth-child(n+3) { display: none; }
}
