.community-page{background:radial-gradient(at top left,#eee3ff,transparent 55%),#faf9ff;color:#171341;min-height:100vh}
.community-section[data-section=people] .community-list{display:flex!important;flex-wrap:nowrap!important;overflow-x:auto!important;overflow-y:visible!important;max-height:none!important;gap:12px;scroll-snap-type:x proximity;padding:10px 2px 16px}
.community-section[data-section=people] .community-card{flex:0 0 200px;box-sizing:border-box;scroll-snap-align:start;min-width:0}
.community-section[data-section=chat] .community-list{max-height:520px;overflow-y:auto}
.community-section[data-section=chat] .community-card{background:#faf8ff;border:0!important;box-shadow:none}
.community-section[data-section=chat] .community-card>p{background:#eeebff;border-radius:8px 18px 18px;padding:12px;color:#211742}
.community-section[data-section=people] .community-card .community-actions button:first-child{background:linear-gradient(110deg,#9000ff,#7333e8);color:white;border:0}
.community-section[data-section=people] .community-card .community-avatar{width:104px;height:104px;flex-basis:104px}
.community-topbar{justify-content:space-between;padding:12px 0}.community-topbar a{text-decoration:none;color:#251451;font-weight:800}.community-topbar button{background:#f3e8ff;border:1px solid #dcc7fa;border-radius:18px;padding:10px 16px;color:#8025cd;font-weight:700}.community-page h1{font-size:clamp(24px,4vw,36px);margin:20px 0 8px}.community-page #notice{color:#75648e;margin:0 0 20px}
.community-tabs{display:flex;gap:8px;overflow:auto;padding:10px 0;position:sticky;top:0;z-index:3;background:#faf9fff5}
.community-tabs button{flex:1;white-space:nowrap;padding:14px 16px;border:0;border-bottom:3px solid transparent;border-radius:14px 14px 0 0;background:#fff;color:#62557c;font-weight:750;font-size:15px;cursor:pointer}
.community-tabs button[aria-pressed=true]{color:#8505ed;border-bottom-color:#8505ed;background:#f3eaff}
.community-section{box-shadow:0 8px 26px #6451a00c;border-color:#e5def4;background:#fff;color:#171341}
.community-section summary{background:#fff;color:#181340;font-size:19px}
.community-card{border:1px solid #e6dff4!important;border-radius:22px;padding:18px;background:linear-gradient(135deg,#fff,#fbf9ff);box-shadow:0 7px 22px #5442900a}
.community-card header{background:transparent!important;color:#181340!important;padding:0!important}
.community-card header strong{color:#181340!important;font-size:16px;min-width:0}
.community-card header time{color:#9485ae;font-size:11px}
.community-avatar{border-radius:50%;width:52px;height:52px;flex-basis:52px;overflow:hidden;background:linear-gradient(135deg,#e5d1ff,#d9f0ff);color:#7c28d4;box-shadow:none}
.community-avatar img{display:block;width:100%;height:100%;object-fit:cover}
.community-section[data-section=people] .community-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.community-section[data-section=people] .community-card{margin:0;text-align:center;min-width:0}
.community-section[data-section=people] header{flex-direction:column;justify-content:center}
.community-section[data-section=people] .community-avatar{width:96px;height:96px;flex-basis:96px;border:4px solid #f5eaff}
.community-section[data-section=people] .community-card>p{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.community-section[data-section=people] .community-actions{justify-content:center}
.community-actions button,.community-button,.community-composer button,.community-dialog button{border-radius:24px;padding:10px 16px;border:1px solid #9c45f5;color:#8010dc;background:white;font-weight:650;cursor:pointer}
.community-section[data-section=people] .community-actions button:first-child,.community-composer button,.community-dialog [type=submit]{background:linear-gradient(115deg,#8500ff,#bd18ee);color:white;border:0;box-shadow:0 4px 12px #9118ec25}
.community-badge{background:#f0e7ff;border-radius:18px;font-weight:650}
.community-section[data-section=chat] .community-card,.community-section[data-section=private] .community-card{background:#fff;border:0!important;box-shadow:none;margin:0;padding:12px}
.community-section[data-section=chat] .community-card>p,.community-section[data-section=private] .community-card>p{background:#f1edff;padding:12px 16px;border-radius:5px 20px 20px;margin-left:60px}
.community-list.scroll{max-height:650px;overflow-y:auto}
.community-composer{display:flex;align-items:center;flex-wrap:wrap;gap:10px;padding:12px;margin-top:12px;border:1px solid #e1d7ef;border-radius:24px;background:#fff}
.community-composer textarea{flex:1;min-width:120px;resize:vertical;border:0;padding:8px;background:#fff;color:#201842;font:inherit}
.community-composer p{flex-basis:100%;margin:0;color:#a12450;font-size:12px}
.community-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.community-search input,.community-search select{border-radius:22px;background:#fcfaff;color:#35264b}
.community-dialog{max-width:620px;color:#231b49;box-shadow:0 18px 70px #73539030}
.community-dialog::backdrop{background:#9680b55c;backdrop-filter:blur(3px)}
.community-avatar-picker{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));max-height:330px;overflow-y:auto}
.community-avatar-picker label{min-width:0;padding:8px;text-align:center;font-size:11px}
.community-avatar-picker .community-avatar{width:56px;height:56px}
.community-avatar-picker label:has(input:checked){background:#eee2ff;border-color:#9400ed}
.community-photo{border:1px dashed #cbb7ed;border-radius:18px;padding:16px}
.community-photo .community-avatar,.community-profile-detail>.community-avatar{width:96px;height:96px}
.community-photo p,.community-hint{font-size:12px;color:#6d6082;line-height:1.5}
.community-profile-detail{text-align:center}.community-profile-detail p{white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:650px){.community-page{padding:10px;margin:0}.community-content{padding:10px}.community-section[data-section=people] .community-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.community-section[data-section=people] .community-card{padding:12px 8px}.community-section[data-section=people] .community-avatar{width:76px;height:76px;flex-basis:76px}.community-actions button{font-size:12px;padding:9px 11px}.community-tabs button{padding:12px 8px;font-size:13px}.community-avatar-picker{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(prefers-reduced-motion:reduce){.community-section *{scroll-behavior:auto!important;transition:none!important}}
/* Reference layout: portrait cards and compact chat bubbles. */
.community-section[data-section=people]>.community-content,.community-section[data-section=chat]>.community-content{padding:16px}
.community-section[data-section=people] .community-card{flex-basis:190px;padding:12px;background:linear-gradient(140deg,#fff,#fcfaff)}
.community-section[data-section=people] .community-card .community-avatar{width:104px;height:104px;flex-basis:104px;border:0;margin:2px auto 10px}
.community-section[data-section=people] .community-card header strong{font-size:16px;font-weight:800}
.community-badge{display:inline-block;padding:6px 12px!important;border-radius:30px;background:#ede3ff;font-size:13px;font-weight:650}
.community-section[data-section=people] .community-card>p{font-size:13px;line-height:1.5;min-height:36px;margin:8px 0}
.community-section[data-section=people] .community-card .community-actions{display:flex;flex-direction:column;gap:8px}
.community-section[data-section=people] .community-card .community-button,.community-section[data-section=people] .community-card .primary-message{width:100%;border-radius:24px;font-size:13px;padding:10px 6px;margin:4px 0}
.community-more{margin-top:8px}.community-more summary{font-size:11px!important;color:#75648e!important;padding:4px!important}.community-more button{margin:4px;font-size:11px}
.community-section[data-section=chat] .community-card{padding:10px 0;margin:4px 0;background:white}
.community-section[data-section=chat] .community-card header{display:flex;align-items:center;gap:10px}
.community-section[data-section=chat] .community-card .community-avatar{width:44px;height:44px;flex-basis:44px}
.community-section[data-section=chat] .community-card>p{margin:4px 0 4px 54px;font-size:14px;padding:12px;border-radius:4px 18px 18px;background:#efecff}
.community-section[data-section=chat] .community-badge{margin-left:54px;font-size:11px;padding:3px 9px!important}
.community-section[data-section=chat] .community-actions{margin-left:54px}.community-composer{align-items:center!important}.community-composer button{border-radius:50%;min-width:54px;min-height:54px;padding:8px}
.community-tabs{box-shadow:0 1px 0 #e6dff4;border-radius:0;background:white}.community-tabs button{background:white!important;border-radius:0!important}
.community-page .community-tabs{flex-wrap:nowrap;overflow-x:auto;gap:0}.community-tabs button{flex:0 0 auto}
.community-section[data-section=people] .community-card>p:empty{display:none}
.community-section[data-section=people] .community-match{font-size:11px;min-height:0;max-height:34px;padding:4px}
.community-section[data-section=people] .community-card header strong{flex:none}
.community-section[data-section=people] .community-list{align-items:flex-start}
.community-section[data-section=chat] .community-content>.community-actions{display:none}
.community-section[data-section=chat] .community-card{flex-shrink:0}
.community-section[data-section=people]>summary,.community-section[data-section=chat]>summary{list-style:none;padding:16px;font-size:21px}
.community-section[data-section=people]>summary::-webkit-details-marker,.community-section[data-section=chat]>summary::-webkit-details-marker{display:none}
.community-shell{margin:16px 0;border:1px solid #e4d9f8;border-radius:24px;background:white;overflow:hidden;color:#181340}
.community-shell>summary{padding:18px;font-size:18px;font-weight:800;cursor:pointer}.community-shell-content{padding:10px}
.community-shell .community-tabs{position:static;margin:0}.community-shell .community-section{margin:12px 0}
.community-button:disabled,.community-actions button:disabled{opacity:.55;cursor:not-allowed}
/* Explicit scoped colors: event theme button rules must not override duel text. */
.community-section button.friendly-duel-button,.community-dialog button.friendly-duel-button{background:linear-gradient(115deg,#8500ff,#a92de5)!important;color:#fff!important;border-color:transparent;box-shadow:0 4px 12px #9118ec25}
.community-shell,.community-shell .community-list{overflow-anchor:none}
.community-shell,.community-dialog{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.community-dialog-close{float:right;width:38px;height:38px;padding:0!important;font-size:26px!important;line-height:1!important}
.community-section[data-section=role_requests]>summary,.community-section[data-section=reports]>summary{background:#fff5df;color:#583908}
.community-section[data-section=chat] .community-actions:empty,.community-section[data-section=private] .community-actions:empty{display:none}
.community-section[data-section=chat] .community-list,.community-section[data-section=private] .community-list{overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#c5b1ed #faf8ff}
.community-section[data-section=chat] .community-card header,.community-section[data-section=private] .community-card header{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.community-section[data-section=chat] .community-card header time,.community-section[data-section=private] .community-card header time{margin-left:auto;color:#746687}
.community-section[data-section=chat] .community-card>p,.community-section[data-section=private] .community-card>p{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.6;box-shadow:0 3px 10px #6e45a008}
.community-section[data-section=chat] .community-actions button{font-size:12px;padding:7px 12px}
.community-composer textarea:focus{outline:2px solid #d3bbff;border-radius:14px}
.community-profile-detail{padding:0 0 22px!important;border-radius:26px!important}
.profile-detail-hero{background:linear-gradient(130deg,#f0e4ff,#f5faff);padding:28px 22px 22px;text-align:center}
.profile-detail-hero .community-avatar{display:inline-grid;width:104px;height:104px;border:5px solid white;box-shadow:0 8px 24px #7744aa20}
.profile-detail-hero h2{margin:14px 0 6px;color:#21133e}.profile-detail-hero p{margin:4px 0 12px;color:#66557d}
.profile-detail-bio,.profile-detail-interests{text-align:left;margin:20px;padding:18px;border:1px solid #e6ddf5;border-radius:20px;background:#fff}
.community-profile-detail h3{margin:0 0 10px;font-size:16px;color:#582298}.profile-detail-bio p{line-height:1.7;color:#302641;margin:0}
.profile-detail-interests div{display:flex;flex-wrap:wrap;gap:8px}.profile-detail-interests span{border-radius:20px;padding:7px 12px;background:#f3ebff;color:#6732ab;font-size:13px}
@media(max-width:480px){.community-section[data-section=chat] .community-card header time{font-size:10px}.community-section[data-section=chat] .community-actions{gap:5px}.community-composer{padding:8px;gap:6px}.community-composer button{font-size:12px}.profile-detail-bio,.profile-detail-interests{margin:14px;padding:14px}}
/* Independent team-race cards retain the light community theme. */
[data-section="team_races"] .community-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));gap:16px}
[data-section="team_races"] .community-card{min-width:0;padding:18px;border:1px solid #dcd0ff;border-radius:22px;background:linear-gradient(145deg,#fff,#f9f5ff);box-shadow:0 8px 24px #673ab714}
[data-section="team_races"] .community-card>p{white-space:pre-line;color:#241b3b;line-height:1.65;overflow-wrap:anywhere}
[data-section="team_races"] .community-card header{background:linear-gradient(110deg,#743de3,#a33ce5)!important;color:white!important;padding:14px!important;border-radius:15px!important}
[data-section="team_races"] .community-actions{display:flex;flex-wrap:wrap;gap:8px}
[data-section="team_races"] .community-button{white-space:normal;min-height:44px;border-radius:13px}
[data-section="team_races"]{font-family:system-ui,-apple-system,"Segoe UI",sans-serif}
[data-section="team_races"] .community-card header strong,[data-section="team_races"] .community-card header time{color:#fff!important}
/* Accessible controls, isolated to the event community. */
.community-card .community-actions button.primary-message:not(:disabled),
.community-card .community-actions button.primary-message:not(:disabled) * {color:#fff !important;}
.community-search {flex-wrap:wrap;gap:10px;}
.community-search .community-check {display:flex;align-items:center;gap:8px;}
.community-search .community-check input {width:auto;}
.community-dialog {max-height:85dvh;overflow-y:auto;}
.community-poll-option {display:flex;gap:8px;margin:12px 0;align-items:center;}
.community-poll-option input {min-width:0;flex:1;}
.community-dialog input[type=color] {height:52px;width:100%;padding:4px;cursor:pointer;}
.community-card p {white-space:pre-line;}
/* Filtered activity cards must stay hidden despite card display rules. */
[data-section="invitations"] [data-card][hidden] { display: none !important; }
/* Invitation outcomes: labels accompany colors, never color-only status. */
.community-card[data-activity-state]{border:2px solid #8649cb!important;background:#faf6ff!important;border-radius:18px}
.community-card[data-activity-state="won"]{border-color:#16844b!important;background:#f2fcf5!important}
.community-card[data-activity-state="lost"]{border-color:#c63441!important;background:#fff5f5!important}
.community-card[data-activity-state="waiting"]{border-color:#d3a323!important;background:#fffbed!important}
.community-card[data-activity-state="playing"],.community-card[data-activity-state="open"]{border-color:#2876ba!important;background:#f3f9ff!important}
.community-activity-meta{display:grid;gap:5px;margin:10px 0;color:#544364;font-size:13px}
.community-activity-meta>div:first-child{font-weight:800;color:#241338}
.community-invitation-toast{position:fixed;right:16px;bottom:16px;z-index:9999;width:min(360px,calc(100vw - 32px));padding:18px;box-sizing:border-box;background:#fffbed;color:#2b2042;border:2px solid #d3a323;border-radius:20px;box-shadow:0 8px 28px #24133826}
.community-invitation-toast p{margin:8px 0}
.community-invitation-toast button{margin-right:8px;background:#7928e8;color:white;border:0;padding:10px 16px;border-radius:12px;cursor:pointer}
.community-card[data-activity-state]>header{display:block!important;background:transparent!important;padding:0!important;color:#241338!important}
.community-card[data-activity-state]>header strong{display:block!important;color:#241338!important;font-size:17px;overflow-wrap:anywhere}
.community-card[data-activity-state]>header time{display:none!important}
.community-card[data-activity-state]>p{white-space:pre-line}
.community-chat-tools{display:inline-flex!important;gap:4px!important;margin:0 0 0 auto!important;align-items:center}.community-chat-tools button{padding:4px!important;min-width:36px!important;min-height:36px!important;width:36px;border:0!important;background:#f1eaff!important;color:#7730d6!important;font-size:19px;line-height:1}.community-chat header{display:flex;flex-wrap:wrap;align-items:center;gap:6px}.community-composer button[type=submit],.community-composer button[type=submit] *{color:#fff!important;background-color:#8029ed}.community-composer button[type=submit]{min-width:48px;border-radius:50%;font-size:23px;padding:10px}



