/* Application community workspace. Selectors do not touch game-room chat. */
#app[data-page=community]{height:100dvh;overflow:hidden}
#app[data-page=community] .bga-main{height:calc(var(--community-window-height,100dvh) - var(--header-height,76px));min-height:0}
#app[data-page=community] .community-workspace{display:grid;grid-template-columns:174px minmax(0,1fr) 192px;gap:0;height:100%;max-width:none;min-height:0;min-width:0;padding:20px;overflow:hidden;position:relative;box-sizing:border-box}
.community-channel-panel,.community-conversation,.community-member-panel{min-width:0;min-height:0;background:var(--surface);border:1px solid var(--border)}
.community-channel-panel{border-radius:14px 0 0 14px;border-right:0;padding:24px 14px;display:flex;flex-direction:column;background:var(--surface-2)}
.community-eyebrow{font-size:10px;letter-spacing:1.6px;color:var(--text-2)}.community-channel-panel>h2{font-size:22px;margin:12px 0 28px;color:var(--text)}
.community-channel-list{display:grid;gap:8px}.community-channel-list>button{display:flex;align-items:center;gap:8px;min-height:46px;padding:10px;font-size:14px;line-height:1.4;text-align:left;border-radius:8px;background:transparent;color:var(--text-2);border:1px solid transparent}
.community-channel-list>button[aria-current=page]{background:var(--brand-soft);border-color:var(--border);color:var(--text);font-weight:700}.community-channel-list svg,.community-channel-list img{width:18px;height:18px;object-fit:contain;flex-shrink:0}.community-channel-list small{margin-left:auto;background:#2162ee;color:#fff;border-radius:10px;font-size:11px;min-width:18px;text-align:center}.community-channel-list small:empty{display:none}
.community-rail-footer{margin-top:auto;padding-top:24px;font-size:13px;border-top:1px solid var(--border)}.community-rail-footer p{color:var(--text-2);line-height:1.7}.community-rail-footer button{width:100%;min-height:44px;font-size:14px}.community-rail-footer a{display:block;font-size:13px;color:var(--text-2);margin-top:18px}
.community-conversation{display:flex;flex-direction:column;overflow:hidden}.community-conversation-header{display:flex;align-items:center;gap:14px;padding:18px 20px;border-bottom:1px solid var(--border);flex-shrink:0;min-height:86px;flex-wrap:wrap}.community-channel-heading{flex:1;min-width:0}.community-channel-heading h1{font-size:21px;margin:0;color:var(--text);line-height:1.5}.community-channel-heading p{font-size:13px;color:var(--text-2);line-height:1.6;margin:3px 0 0}.community-channel-heading select{display:none}.community-connection{font-size:12px;line-height:1.7;color:var(--text-2)}.community-connection[data-connected=true]::before{content:'● ';color:#25835b}.community-connection[data-connected=false]::before{content:'● ';color:#b97932}
.community-member-toggle{display:none;min-height:44px;padding:8px 10px;font-size:13px;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:var(--text)}
.community-guideline{padding:10px 20px;font-size:12px;line-height:1.7;background:var(--surface-2);color:var(--text-2);flex-shrink:0;border-bottom:1px solid var(--border)}
.community-log-wrap{flex:1;min-height:0;position:relative;overflow:hidden}.community-timeline{height:100%;overflow-y:auto;overflow-x:hidden;padding:22px 20px;overscroll-behavior:contain;scrollbar-gutter:stable;overflow-anchor:none}
.community-message{display:flex;align-items:flex-start;gap:14px;padding:10px 0;min-width:0}.community-avatar{display:flex;flex-direction:column;position:relative;flex:0 0 44px;width:44px;height:54px;background:var(--surface-3);border-radius:0;overflow:hidden}.community-avatar>img,.community-avatar>.avatar-face{display:block;aspect-ratio:1;width:44px;height:44px;object-fit:cover;border-radius:0;font-size:30px;text-align:center;line-height:44px}.community-avatar>small{display:block;position:absolute;bottom:0;left:0;right:0;background:#142335bf;color:white;text-align:center;font-size:9px;line-height:14px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.community-message-body{flex:1;min-width:0}.community-message-meta{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;font-size:14px;color:var(--text)}.community-message-meta time{font-size:11px;color:var(--text-2);font-variant-numeric:tabular-nums}.community-message-meta small{font-size:10px;color:#2162ee;padding:1px 5px;border:1px solid var(--border);border-radius:4px}.community-message p{font-size:15px;line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;margin:5px 0 0;color:var(--text)}
.community-empty{display:grid;justify-items:center;align-content:center;min-height:100%;padding:24px;text-align:center;color:var(--text-2)}.community-empty>svg,.community-empty>img{width:44px;height:44px;object-fit:contain;margin-bottom:12px}.community-empty h2{font-size:21px;color:var(--text);margin:10px 0}.community-empty p{font-size:14px;line-height:1.8;margin:0}
.community-new-messages{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);z-index:2;background:#2162ee;color:white;border:0;border-radius:22px;padding:10px 18px;min-height:44px;font-size:13px;white-space:nowrap;box-shadow:0 4px 14px #12335530}.community-new-messages[hidden]{display:none}
.community-send-error:not([hidden]){display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:6px;margin-top:4px;color:var(--text-2);font-size:12px}.community-send-error button{min-height:36px;padding:4px 10px;font-size:12px}
.community-composer{padding:14px 18px 10px;border-top:1px solid var(--border);flex-shrink:0;background:var(--surface)}.community-composer textarea{display:block;resize:none;width:100%;min-height:44px;max-height:112px;padding:11px 12px;border:1px solid var(--border-strong);border-radius:10px;background:var(--surface-2);color:var(--text);font:inherit;font-size:15px;line-height:1.5;box-sizing:border-box}.community-composer-tools{display:flex;align-items:center;gap:12px;margin-top:8px}.community-emoji{width:44px;height:44px;background:var(--surface);color:var(--text-2);border:1px solid var(--border);border-radius:8px;font-size:24px}.community-input-hint{font-size:11px;color:var(--text-2)}.community-send{min-height:44px;padding:8px 20px;font-size:14px}.community-feedback{font-size:12px;color:var(--text-2);margin:5px 0 0;min-height:0;line-height:1.5}.community-feedback:empty{display:none}.community-composer .sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.community-member-panel{border-left:0;border-radius:0 14px 14px 0;padding:24px 14px;overflow:auto}.community-member-panel h2{font-size:16px;color:var(--text);margin:0 0 20px}.community-member-note{font-size:11px;line-height:1.8;color:var(--text-2)}.community-member{display:flex;align-items:center;gap:10px;padding:10px 0;font-size:13px;min-width:0}.community-member>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text)}.community-member .community-avatar{flex-basis:36px;width:36px;height:44px}.community-member .community-avatar>img,.community-member .community-avatar>.avatar-face{width:36px;height:36px;line-height:36px;font-size:25px}
@media(max-width:1280px){#app[data-page=community] .community-workspace{grid-template-columns:160px minmax(0,1fr)}.community-conversation{border-radius:0 14px 14px 0}.community-member-panel{display:none}.community-member-toggle{display:block}.community-member-panel.is-open{display:block;position:absolute;top:102px;right:36px;bottom:36px;width:min(240px,calc(100% - 72px));z-index:4;border:1px solid var(--border-strong);border-radius:12px;box-shadow:0 12px 35px #14203030}.community-input-hint{display:none}}
@media(max-width:880px){#app[data-page=community] .bga-main{height:calc(var(--community-window-height,100dvh) - var(--header-height,64px) - var(--community-bottom-height,68px))}#app[data-page=community] .community-workspace{padding:12px;height:100%;grid-template-columns:150px minmax(0,1fr)}#app.community-keyboard .site-bottom-nav{display:none}}
@media(max-width:700px){#app[data-page=community] .community-workspace{display:flex;padding:0;flex-direction:column}.community-channel-panel{display:none}.community-conversation{height:100%;border-radius:0;border:0}.community-conversation-header{padding:10px 14px;gap:8px;min-height:78px}.community-channel-heading h1{display:none}.community-channel-heading select{display:block;max-width:100%;font-size:17px;font-weight:700;min-height:36px;padding:4px 6px;background:var(--surface);color:var(--text);border:0}.community-channel-heading p{font-size:12px;margin:0;line-height:1.5}.community-connection{font-size:10px}.community-member-toggle{font-size:12px;min-height:44px;padding:8px}.community-guideline{padding:8px 14px;font-size:11px}.community-timeline{padding:14px}.community-message{gap:10px}.community-avatar{flex-basis:40px;width:40px;height:50px}.community-avatar>img,.community-avatar>.avatar-face{width:40px;height:40px;line-height:40px}.community-message p{font-size:15px}.community-composer{padding:10px 12px 8px}.community-composer textarea{font-size:16px}.community-composer-tools{gap:10px}.community-member-panel.is-open{top:78px;right:12px;bottom:12px}.community-channel-heading{flex-basis:calc(100% - 105px)}.community-connection{order:3;width:100%;margin-top:-3px}.community-member-toggle{margin-left:auto}.community-conversation-header{min-height:94px}.community-empty h2{font-size:20px}.community-empty{padding:16px}}
@media(max-height:500px) and (max-width:1000px){#app[data-page=community] .community-workspace{display:flex;padding:0}.community-channel-panel{display:none}.community-conversation{width:100%;height:100%;border:0;border-radius:0}.community-conversation-header{padding:6px 12px;min-height:54px;flex-wrap:nowrap}.community-channel-heading h1,.community-channel-heading p,.community-connection,.community-guideline{display:none}.community-channel-heading select{display:block;min-height:40px;border:0;background:var(--surface);color:var(--text);font-size:17px}.community-composer{padding:6px 12px}.community-composer-tools{margin-top:4px}.community-member-toggle{display:block}.community-member-panel.is-open{top:54px;bottom:12px}.community-rail-footer{display:none}}
.community-composer textarea{min-height:48px;overflow-y:auto}
html[data-theme=dark] .community-channel-list>button[aria-current=page]{background:#2c425a;color:#f0f6ff;border-color:#49617b}
html[data-theme=dark] #app[data-page]:not([data-page=room]) .sidebar-item.active{background:#2c425a;color:#f0f6ff;border-color:#49617b}

/* Same paper, bubbles and composer proportions as the room conversation. */
#app[data-page=community] .community-workspace{grid-template-columns:160px minmax(0,1fr);padding:0;gap:0}
.community-workspace{--surface:#fffdf7;--surface-2:#f4f1e7;--text:#292d3e;--text-2:#77786f;--text-3:#959387;--border:#e8e4d6;--brand:#6062c9;--brand-soft:#eeedf9;--bubble:#f2efe7;--bubble-self:#e9e5fb;--on-brand:#fff}
html[data-theme=dark] .community-workspace{--surface:#242b3b;--surface-2:#303747;--text:#efeee4;--text-2:#bdc0bd;--text-3:#a6aaa8;--border:#424956;--brand:#b8b4ff;--brand-soft:#353b53;--bubble:#30394a;--bubble-self:#454667;--on-brand:#202738}
.community-channel-panel{padding:14px 10px;border-radius:0;border:0;border-right:1px solid var(--border)}.community-eyebrow{display:none}.community-channel-panel>h2{font-size:18px;margin:0 0 14px}.community-rail-footer{display:none}
.community-conversation{border:0;border-radius:0}.community-conversation-header{min-height:48px;padding:6px 14px;gap:8px;flex-wrap:nowrap}.community-channel-heading h1{font-size:17px;line-height:1.5}.community-connection{font-size:12px;white-space:nowrap;order:0;width:auto;margin:0}.community-member-toggle,.community-member-panel{display:none!important}
.community-timeline{box-sizing:border-box;padding:8px 14px;scrollbar-gutter:auto}.community-message{gap:9px;padding:7px 0}.community-message-body{flex:0 1 auto;max-width:calc(100% - 49px)}.community-message-meta{gap:6px;font-size:11px;min-height:16px;line-height:1.4;margin-bottom:4px}.community-message-meta time{font-size:10px;margin-left:auto}.community-message-meta small{display:none}.community-avatar{flex:0 0 36px;width:36px;height:46px}.community-avatar>img,.community-avatar>.avatar-face{width:36px;height:36px;line-height:36px}.community-message p.community-bubble{margin:0;padding:9px 11px;border-radius:3px 13px 13px 13px;background:var(--bubble);font-size:14px;line-height:1.65}.community-message.is-self{flex-direction:row-reverse}.community-message.is-self .community-bubble{background:var(--bubble-self);border-radius:13px 3px 13px 13px}.community-message.is-self .community-message-meta{justify-content:flex-end}.community-message.is-self time{margin:0}.community-message p.is-sticker{padding:0;background:transparent!important}.community-bubble>.sticker-img{width:110px;height:110px;display:block}
.community-composer{position:relative;display:flex;align-items:center;gap:6px;margin:0;padding:8px 12px;border-top:1px solid var(--border);background:var(--surface)}.community-composer textarea{flex:1;min-width:0;border-radius:8px;border:1px solid var(--border);background:var(--surface);font-size:14px;line-height:1.5;padding:9px 10px;min-height:42px!important;max-height:96px}.community-emoji{flex:none;min-width:32px;width:32px;height:40px;font-size:23px;border:0;background:transparent;padding:0}.community-send{flex:none;min-height:42px;padding:8px 12px;font-size:14px}.community-feedback{position:absolute;bottom:100%;left:8px;padding:4px 8px;background:var(--surface);border-radius:8px}
@media(max-width:880px){#app[data-page=community] .community-workspace{padding:0;grid-template-columns:140px minmax(0,1fr)}}
@media(max-width:700px){#app[data-page=community] .community-workspace{display:flex}.community-conversation-header{min-height:44px;padding:4px 10px}.community-channel-heading{flex:1;min-width:0}.community-channel-heading select{display:block;min-height:36px;font-size:16px}.community-connection{font-size:11px;display:block}.community-timeline{padding:6px 10px}.community-composer{padding:6px 8px}.community-composer textarea{font-size:16px}.community-message p.community-bubble{font-size:14px}.community-conversation{min-width:0;width:100%}}
@media(max-height:500px) and (max-width:1000px){.community-channel-panel{display:none}.community-conversation-header{min-height:42px}.community-connection{display:block}.community-channel-heading select{display:block}.community-channel-heading h1{display:none}}

html[data-theme] #app.cinema-shell[data-page=community] .bga-content.community-workspace{padding:0;margin:0;max-width:none;width:100%;height:100%;min-height:0}html[data-theme] #app.cinema-shell[data-page=community] .community-send{box-sizing:border-box;min-height:42px;padding:8px 10px;border:0;border-radius:8px;background:var(--brand);color:var(--on-brand);font-size:13px;box-shadow:none}
html[data-theme] #app.cinema-shell[data-page=community] .bga-main{height:calc(var(--community-window-height,100dvh) - var(--community-header-height,65px) - var(--community-bottom-height,0px));min-height:0}
/* Direct channel buttons on every screen; never a hidden selector. */
#app[data-page=community] .community-workspace{display:flex;grid-template-columns:none}
.community-conversation{width:100%;height:100%;min-height:0}
.community-conversation-header{flex:none;min-height:44px}
.community-channel-list{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow-x:auto}
.community-channel-list>button{display:flex;align-items:center;justify-content:center;gap:3px;flex:1;min-width:0;min-height:36px;padding:5px 7px;white-space:nowrap;font-size:13px;border:0;border-radius:6px}
.community-channel-list>button>svg{display:none}.community-channel-list>button>small:empty{display:none}
@media(max-width:480px){.community-conversation-header{flex-wrap:wrap;gap:1px;padding:4px 8px}.community-channel-list{flex-basis:100%}.community-channel-list>button{font-size:12px;padding:5px 2px}.community-connection{font-size:10px;margin-left:auto;line-height:14px}}

/* A single channel navigation with presence inside the same region. */
#app[data-page=community] .community-workspace {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}
#app[data-page=community] .community-channel-bar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 12px 8px;
  border-inline-end: 1px solid var(--border);
  background: var(--surface-2);
}
#app[data-page=community] .community-channel-list {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  overflow: auto;
}
#app[data-page=community] .community-channel-list > button {
  flex: none;
  justify-content: flex-start;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
}
#app[data-page=community] .community-channel-list > button[aria-current=page] {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
}
#app[data-page=community] .community-channel-list > button > :is(svg,img) {
  display: block;
  width: 16px;
  height: 16px;
}
#app[data-page=community] .community-channel-list > button > small { background: #db3445; }
#app[data-page=community] .community-channel-bar > .community-connection {
  flex: none;
  padding: 8px 10px 0;
  color: var(--text-2);
  font-size: 12px;
}
@media (min-width: 881px) {
  #app[data-page=community] .community-channel-bar > .community-connection {
    order: -1;
    padding: 0 10px 8px;
  }
}
#app[data-page=community] .community-conversation {
  min-width: 0;
  min-height: 0;
}
@media (max-width: 880px) {
  #app[data-page=community] .community-workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  #app[data-page=community] .community-channel-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px;
    align-items: center;
    padding: 4px 6px;
    border-inline-end: 0;
    border-bottom: 1px solid var(--border);
  }
  #app[data-page=community] .community-channel-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
    overflow: hidden;
  }
  #app[data-page=community] .community-channel-list > button {
    position: relative;
    justify-content: center;
    gap: 0;
    padding: 4px 1px;
    font-size: 12px;
  }
  #app[data-page=community] .community-channel-list > button > :is(svg,img) {
    display: none;
  }
  #app[data-page=community] .community-channel-list > button > small:not(:empty) {
    position: absolute;
    top: 4px;
    inset-inline-end: 4px;
    min-width: 6px;
    width: 6px;
    height: 6px;
    margin: 0;
    overflow: hidden;
    font-size: 0;
  }
  #app[data-page=community] .community-channel-bar > .community-connection {
    margin: 0;
    padding: 0 1px;
    font-size: 10px;
    white-space: nowrap;
  }
}
/* The message pane owns scrolling and the composer stays below it. */
#app[data-page=community] .community-conversation {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#app[data-page=community] .community-conversation > .community-composer {
  flex: none;
}

#app[data-page=community] .community-log-wrap {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

#app[data-page=community] .community-timeline {
  height: 100%;
  overflow: hidden auto;
  overscroll-behavior: contain;
}

.community-message .community-avatar:not(:has(> small)){height:auto;aspect-ratio:1}

#app[data-page=community] .community-conversation[hidden],
#app[data-page=community] .community-origins[hidden] {
  display: none;
}
.community-origins {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(16px, 4vw, 42px);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
}
.community-origins > * {
  display: block;
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
}
.community-origins h2 {
  margin-block: 0 14px;
  font-size: clamp(19px, 3vw, 27px);
}
.community-origins img {
  height: auto;
  border-radius: 8px;
}
.community-origins p {
  margin-block: 16px 0;
  font-size: 15px;
  line-height: 1.8;
}
@media (max-width: 880px) {
  .community-origins {
    border: 0;
    border-radius: 0;
  }
}
