.community-shell { display: grid; gap: 14px; padding-bottom: 20px; color: #173f2d; }
.community-hero { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 20px; border: 1px solid #dfa83d; border-radius: 17px; background: linear-gradient(135deg, #fff9eb, #f4ead3); }
.community-hero > div:first-child { display: grid; align-content: center; gap: 7px; }
.community-hero h2, .community-card h3, .community-card h4 { margin: 0; color: #104d32; }
.community-hero p, .community-card p { margin: 0; color: #705f4c; }
.community-shield { display: grid; place-items: center; width: 74px; height: 82px; border-radius: 24px 24px 34px 34px; background: linear-gradient(145deg, #176b45, #0b3d27); color: #ffd762; font-size: 38px; box-shadow: 0 9px 20px rgba(7, 54, 34, .22); }
.community-tabs { display: flex; gap: 9px; overflow-x: auto; padding: 5px 0; margin: 2px 0; scrollbar-width: thin; }
.community-tabs button { flex: 0 0 auto; min-height: 42px; padding: 9px 15px; border: 1px solid #dbaa45; border-radius: 999px; background: #fff9ed; color: #174b34; font: inherit; font-weight: 800; cursor: pointer; }
.community-tabs button.active { background: #125a3a; color: #fff7df; }
.community-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.community-shell input, .community-shell select, .community-shell textarea { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #d9a541; border-radius: 10px; background: #fff4d5 !important; color: #3b332a !important; font: inherit; box-sizing: border-box; }
.community-shell textarea { min-height: 88px; resize: vertical; }
.community-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); gap: 11px; }
.community-card { display: grid; gap: 9px; padding: 15px; border: 1px solid #dda63c; border-radius: 14px; background: #fffaf0; box-shadow: 0 7px 17px rgba(44, 31, 9, .08); color: #44372d; }
.community-membership-groups, .community-membership-group { display: grid; gap: 13px; }
.community-membership-groups { gap: 22px; }
.community-section-heading { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 11px; align-items: center; }
.community-section-heading > span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #14613f; color: #fff8e7; font-weight: 950; }
.community-section-heading h3, .community-section-heading p { margin: 0; }
.community-section-heading h3 { color: #134c34; }
.community-section-heading p { margin-top: 3px; color: #665548; }
.community-relation { justify-self: start; padding: 5px 10px; border-radius: 999px; background: #e9dfca; color: #5f5144; font-size: 12px; font-weight: 900; }
.community-relation.owner { background: #14613f; color: #fff8e7; }
.community-owned-card { border-width: 2px !important; border-color: #c89125 !important; box-shadow: 0 9px 22px rgba(138, 91, 12, .14) !important; }
.community-member-card { background: linear-gradient(145deg, #fffdf7 0%, #f2ecdf 100%) !important; }
.community-card-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 11px; align-items: center; }
.community-card-shield { display: grid; place-items: center; width: 46px; height: 52px; border-radius: 13px 13px 19px 19px; background: var(--club-primary, #155b3b); color: var(--club-secondary, #ffd25c); font-size: 23px; }
.community-card-shield img, .community-shield img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.community-logo-form { margin-top: 10px; padding-top: 12px; border-top: 1px solid rgba(205, 153, 52, .42); }
.community-details-form { margin-top: 12px; padding: 14px; border: 1px solid rgba(205, 153, 52, .48); border-radius: 12px; background: #fff8e8; }
.community-verification-check { grid-template-columns: auto minmax(0, 1fr) !important; align-items: start; }
.community-verification-check input { width: 20px !important; min-height: 20px !important; margin-top: 2px; accent-color: #14613f; }
.community-logo-form input[type="file"] { padding: 8px; }
.community-upload-field { position: relative; display: grid; gap: 7px; color: #174b34; }
.community-file-native { position: absolute !important; left: 8px !important; bottom: 8px !important; width: 1px !important; height: 1px !important; min-height: 1px !important; padding: 0 !important; overflow: hidden !important; opacity: 0 !important; clip-path: inset(50%) !important; white-space: nowrap !important; border: 0 !important; pointer-events: none !important; }
.community-file-bar { display: grid !important; grid-template-columns: auto minmax(0, 1fr); gap: 11px; align-items: center; min-height: 46px; padding: 6px 9px !important; border: 1px solid #d9a541 !important; border-radius: 10px; background: #fff4d5 !important; color: #493d32 !important; cursor: pointer; }
.community-file-bar > span { padding: 7px 12px; border: 1px solid #d49b2d; border-radius: 7px; background: #f7d692; color: #2f342c; font-weight: 850; text-align: center; }
.community-file-bar > b { min-width: 0; overflow: hidden; color: #5d4e40; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.community-file-bar:hover > span { background: #efc96f; }
.community-logo-preview { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px; border: 1px solid rgba(207, 155, 52, .45); border-radius: 11px; background: #fff8e8; }
.community-logo-preview > :is(img, span) { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 14px; object-fit: cover; background: #14613f; color: #ffd661; font-size: 32px; }
.community-logo-preview div { display: grid; gap: 4px; }
.community-logo-preview small { color: #665548; }
.community-logo-status { min-height: 20px; margin: 0 !important; color: #8a3e24 !important; font-weight: 800; }
@media (max-width: 520px) { .community-file-bar { grid-template-columns: 1fr; }.community-file-bar > b { padding: 2px 4px; text-align: center; } }
.community-meta { display: flex; flex-wrap: wrap; gap: 6px; color: #755f48; font-size: 13px; }
.community-meta span { padding: 4px 8px; border-radius: 999px; background: #f6e8c7; }
.community-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 5px; }
.community-actions button, .community-primary, .community-secondary { min-height: 41px; padding: 8px 14px; border: 1px solid #d99d27; border-radius: 10px; font: inherit; font-weight: 850; cursor: pointer; }
.community-primary { background: #14633f; color: #fff9e7; }
.community-secondary { background: #f7d692; color: #2e3027; }
.community-danger { min-height: 41px; padding: 8px 14px; border: 1px solid #922c25; border-radius: 10px; color: #fff9f0; background: #a52e26; font: inherit; font-weight: 850; cursor: pointer; }
.community-danger:hover:not(:disabled) { background: #8f241f; }
.community-primary:disabled, .community-secondary:disabled { opacity: .5; cursor: not-allowed; }
.community-empty { display: grid; gap: 13px; padding: 30px 18px; border: 1px dashed #d0a04a; border-radius: 14px; background: rgba(255, 249, 233, .76); text-align: center; color: #705f4c; }
.community-empty :is(h2, h3, h4, p) { margin: 0; }
.community-empty .community-actions { justify-content: center; margin-top: 2px; }
.community-form { display: grid; gap: 12px; }
.community-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.community-form label { display: grid; gap: 5px; color: #174b34; font-weight: 800; }
.community-span { grid-column: 1 / -1; }
.community-progress { height: 9px; overflow: hidden; border-radius: 99px; background: #eadbb9; }
.community-card-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.community-lifecycle { display: grid; gap: 4px; margin: 8px 0 12px; padding: 11px 13px; border: 1px solid #d9aa45; border-left-width: 5px; border-radius: 10px; background: #fff0c4; color: #5d4e40; }
.community-lifecycle strong { color: #154c32; }
.community-lifecycle span { line-height: 1.35; }
.community-lifecycle.inactive { border-left-color: #bd721c; background: #fff1d6; }
.community-lifecycle.archived { border-left-color: #7b6b55; background: #eee7db; }
.community-badge.lifecycle-premium_grace { color: #65430d; background: #f7d692; }
.community-badge.lifecycle-inactive { color: #fff8e8; background: #a85f16; }
.community-badge.lifecycle-archived { color: #fff; background: #6b6256; }
.community-premium-required { max-width: 190px; color: #8a5c12; font-size: 12px; font-weight: 700; line-height: 1.25; }
.community-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #169258, #e0af3f); }
.community-ranking { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: 10px; align-items: center; }
.community-rank { color: #b57807; font-size: 22px; font-weight: 950; text-align: center; }
.community-chat { display: grid; gap: 7px; max-height: min(42vh, 410px); overflow: auto; padding: 4px; }
.community-chat article { padding: 9px 11px; border-radius: 10px; background: #f5e8ca; }
.community-chat article.system { border-left: 4px solid #ddb03f; }
.community-chat strong { color: #14563a; }
.community-member { display: grid; grid-template-columns: 1fr auto; gap: 9px; align-items: center; padding: 9px; border-radius: 10px; background: #f8edd3; }
.community-friend-button { display: block; width: fit-content; min-height: 32px !important; margin-top: 7px; padding: 5px 10px !important; border: 1px solid #cf9323 !important; border-radius: 8px !important; background: #fff8e7 !important; color: #145238 !important; font-size: 12px !important; font-weight: 800 !important; cursor: pointer; }
.community-friend-state { display: block; width: fit-content; margin-top: 6px; color: #6d5a47; font-size: 12px; font-weight: 750; }
.online-club-invite { display: grid; gap: 8px; margin-top: 14px; padding-top: 13px; border-top: 1px solid rgba(205, 153, 52, .45); }
.online-club-invite :is(p, small) { margin: 0; }
.community-badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; background: #14593a; color: #fff8e7; font-size: 11px; font-weight: 900; }
.tournament-card { position: relative; overflow: hidden; }
.tournament-card::after { content: "♣"; position: absolute; right: -12px; bottom: -37px; color: rgba(20, 83, 54, .07); font-size: 120px; pointer-events: none; }
.tournament-card.is-expired { filter: grayscale(1); opacity: .68; }
.tournament-card.is-expired > :not(.tournament-state-banner) { opacity: .72; }
.tournament-state-banner { position: relative; z-index: 3; display: inline-flex; align-items: center; justify-content: center; width: fit-content; min-height: 28px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 950; letter-spacing: .07em; text-transform: uppercase; }
.tournament-state-banner.expired { position: absolute; top: 47%; left: -8%; width: 116%; min-height: 38px; border-block: 2px solid #f2f2f2; border-radius: 0; color: #fff; background: rgba(45,45,45,.88); box-shadow: 0 5px 16px rgba(0,0,0,.25); transform: rotate(-7deg); pointer-events: none; }
.tournament-state-banner.playing { align-self: flex-start; color: #fff9e8; background: #a5261d; box-shadow: 0 4px 10px rgba(130,24,18,.25); }
.tournament-state-banner.playing i { width: 9px; height: 9px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.2); animation: tournament-live-pulse 1.4s ease-in-out infinite; }
@keyframes tournament-live-pulse { 50% { opacity: .45; transform: scale(.78); } }
.tournament-card.is-notification-target { border-width: 3px !important; border-color: #19844e !important; box-shadow: 0 0 0 5px rgba(25,132,78,.18), 0 12px 26px rgba(31,75,48,.2) !important; animation: tournament-target-highlight 1.1s ease-in-out 2; }
@keyframes tournament-target-highlight { 50% { transform: translateY(-3px); box-shadow: 0 0 0 8px rgba(25,132,78,.12), 0 15px 30px rgba(31,75,48,.24); } }
.tournament-card.is-completed { cursor: pointer; }
.tournament-card.is-completed:focus-visible { outline: 3px solid #177447; outline-offset: 3px; }
.tournament-result-overview { display: grid; gap: 10px; padding: 18px; border: 2px solid #d3a13c; border-radius: 16px; background: linear-gradient(145deg, #fff9e8, #efe6d2); color: #40352c; }
.tournament-result-overview h3, .tournament-result-overview p { margin: 0; }
.tournament-result-overview h3 { color: #124c32; }
.tournament-result-list { display: grid; gap: 8px; }
.tournament-result-list article { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 7px 12px; align-items: center; padding: 11px; border: 1px solid #ddbd79; border-radius: 11px; background: #fffaf0; }
.tournament-result-list article > strong:last-of-type { text-align: right; }
.tournament-result-list article > small { grid-column: 1 / -1; color: #6b5947; }
@media (max-width: 560px) { .tournament-result-list article { grid-template-columns: 1fr; }.tournament-result-list article > strong:last-of-type { text-align: left; }.tournament-result-list article > small { grid-column: 1; } }
.tournament-bracket { display: flex; gap: 16px; overflow-x: auto; padding: 8px; }
.tournament-round { flex: 0 0 235px; display: grid; align-content: center; gap: 10px; }
.tournament-match { display: grid; gap: 4px; padding: 10px; border: 1px solid #d8ad58; border-radius: 10px; background: #fff6df; }
.community-note { display: grid; gap: 8px; padding: 13px 14px; border-left: 4px solid #d8a329; border-radius: 8px; background: #fff1ca; color: #594a3d; line-height: 1.35; }
.community-note > br { display: none; }
.community-note > strong { display: block; margin: 0; }
.community-note .community-actions { margin-top: 2px; }
.community-ad { display: grid; place-items: center; min-height: 110px; padding: 12px; border: 1px dashed #b99a5e; border-radius: 12px; background: #f4efe4; color: #715f49; text-align: center; }
html[data-theme="dark"] .community-shell { color: #f7efd9; }
html[data-theme="dark"] .community-hero, html[data-theme="dark"] .community-card { border-color: rgba(226, 178, 72, .62); background: linear-gradient(145deg, rgba(17, 65, 43, .96), rgba(8, 43, 28, .96)); color: #fff8e8; }
html[data-theme="dark"] .community-hero h2, html[data-theme="dark"] .community-card h3, html[data-theme="dark"] .community-card h4 { color: #fff7df; }
html[data-theme="dark"] .community-hero p, html[data-theme="dark"] .community-card p, html[data-theme="dark"] .community-meta { color: #eadfca; }
html[data-theme="dark"] .community-meta span, html[data-theme="dark"] .community-member, html[data-theme="dark"] .community-chat article, html[data-theme="dark"] .tournament-match { background: rgba(255,255,255,.09); color: #fff6e6; }
@media (max-width: 680px) { .community-hero { grid-template-columns: 1fr; }.community-shield { display: none; }.community-toolbar, .community-form-grid { grid-template-columns: 1fr; }.community-span { grid-column: auto; }.community-grid { grid-template-columns: 1fr; }.community-actions > * { flex: 1; }.community-card-head { grid-template-columns: auto minmax(0,1fr); }.community-card-head > :last-child { grid-column: 1 / -1; } }

/* Communityvensters volgen altijd het lichte popupontwerp. De spelmodus mag
   niet opnieuw grote donkergroene leesvlakken over deze inhoud leggen. */
#onlineContent .community-shell,
html[data-theme="dark"] #onlineContent .community-shell {
  color: #40352c !important;
}

#onlineContent .community-hero,
#onlineContent .community-card,
html[data-theme="dark"] #onlineContent .community-hero,
html[data-theme="dark"] #onlineContent .community-card {
  border: 1px solid #dfa83d !important;
  background: linear-gradient(145deg, #fffaf0 0%, #f6eddc 100%) !important;
  color: #40352c !important;
  box-shadow: 0 7px 18px rgba(64, 48, 24, .09) !important;
}

#onlineContent .community-hero {
  background: linear-gradient(135deg, #fff7e6 0%, #efe4cc 100%) !important;
}

#onlineContent .community-hero h2,
#onlineContent .community-card h3,
#onlineContent .community-card h4,
#onlineContent .community-card strong,
html[data-theme="dark"] #onlineContent .community-hero h2,
html[data-theme="dark"] #onlineContent .community-card :is(h3, h4, strong) {
  color: #134c34 !important;
  text-shadow: none !important;
}

#onlineContent .community-hero p,
#onlineContent .community-card p,
#onlineContent .community-meta,
html[data-theme="dark"] #onlineContent .community-hero p,
html[data-theme="dark"] #onlineContent .community-card p,
html[data-theme="dark"] #onlineContent .community-meta {
  color: #665548 !important;
  text-shadow: none !important;
}

#onlineContent .community-meta span,
#onlineContent .community-member,
#onlineContent .community-chat article,
#onlineContent .tournament-match,
html[data-theme="dark"] #onlineContent :is(.community-meta span, .community-member, .community-chat article, .tournament-match) {
  border: 1px solid rgba(208, 156, 54, .35) !important;
  background: #f7e9c9 !important;
  color: #493d32 !important;
}

#onlineContent .community-progress {
  background: #ead8af !important;
}

#onlineContent .community-tabs button:not(.active) {
  background: #fff9ed !important;
  color: #174b34 !important;
}

#onlineContent .community-tabs button.active {
  background: #14613f !important;
  color: #fff9e8 !important;
}

#onlineContent .community-empty,
html[data-theme="dark"] #onlineContent .community-empty {
  background: #fff9ed !important;
  color: #665548 !important;
}
