/* RT gamer refinement. Uses the existing palette and component structure. */
:root{--rtp-game-accent:#7561ee;--rtp-focus:#8d79ff}
:root[data-theme=dark]{--rtp-game-accent:#a795ff;--rtp-focus:#c1b6ff}
.rtp-auth-card,.rtp-account-setting-card,.rtp-activity-card,.rtp-member-card{border-radius:20px;box-shadow:0 8px 24px rgba(23,18,55,.06)}
.rtp-auth-card{border-top:3px solid var(--rtp-game-accent)}
.rtp-kicker{color:var(--rtp-game-accent);letter-spacing:.1em}
.rtp-btn,.rtp-icon-button,.rtsm-report-button{min-height:44px}
.rtp-challenge-button{background:linear-gradient(115deg,#6552d9,#8759db);color:#fff!important;border:0;box-shadow:0 4px 14px rgba(101,82,217,.18)}
.rtp-challenge-button:disabled{opacity:.65;cursor:wait}
.rtp-challenge-button.is-sent{background:#216546;cursor:default}
.rtp-live-challenge{display:block;padding:14px;margin:8px;border:1px solid var(--rtp-line);border-left:3px solid var(--rtp-game-accent);border-radius:12px;color:var(--rtp-text);font-weight:600}
.rtp-account-editor input:not([type=checkbox]),.rtp-auth-form input:not([type=checkbox]),.rtp-account-editor select{min-height:44px;font-size:16px}
.rtp-account-setting-card{scroll-margin-top:100px}
.rtp-feed-ad [data-rtsm-report],.rt-ad [data-rtsm-report]{display:block;margin:10px 14px;padding:8px 12px;border:1px solid var(--rtp-line);border-radius:10px;background:var(--rtp-surface);color:var(--rtp-text);cursor:pointer}
:where(a,button,input,textarea,select):focus-visible{outline:3px solid var(--rtp-focus);outline-offset:3px}
.rtp-auth-card p,.rtp-account-setting-main p{line-height:1.6}
@media(max-width:600px){.rtp-auth-card{padding:24px 18px}.rtp-challenge-button{width:100%;justify-content:center}.rtp-account-editor{overflow-wrap:anywhere}.rtp-account-settings-grid{grid-template-columns:minmax(0,1fr)}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}

/* Community layouts: one BuddyPress result set, three presentations. */
#buddypress .rtp-community-viewbar{display:flex!important;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:14px;border:1px solid var(--rtp-line);border-radius:16px;background:var(--rtp-surface);margin-bottom:16px}
#buddypress .rtp-community-viewbuttons{display:flex;gap:6px;flex-wrap:wrap;min-width:0;max-width:100%;box-sizing:border-box}
#buddypress .rtp-community-viewbuttons button{min-height:52px!important;min-width:52px;padding:10px 14px!important;border:1px solid var(--rtp-line)!important;border-radius:10px!important;background:var(--rtp-surface-2)!important;color:var(--rtp-text)!important;font-size:14px!important;font-weight:700!important;cursor:pointer}
#buddypress .rtp-community-viewbuttons button.is-active{background:#5540bc!important;border-color:#8a73ec!important;color:#fff!important;box-shadow:inset 0 -2px 0 #d8b66a}
#buddypress .rtp-members-grid{gap:16px!important}
#buddypress .rtp-members-grid .rtp-member-card{min-width:0!important;margin:0!important}
#buddypress .rtp-member-actions{display:flex!important;flex-direction:column!important;gap:10px!important;padding-top:10px}
#buddypress .rtp-member-bp-buttons{display:flex!important;gap:8px!important;flex-wrap:wrap!important;justify-content:center!important;width:100%}
#buddypress .rtp-member-bp-buttons .generic-button{margin:0!important;max-width:100%}
#buddypress .rtp-member-actions :is([data-rt-challenge-user],[data-rt-truco-social-challenge],.rt-truco-challenge-btn),.rtp-member-profile-actions :is([data-rt-challenge-user],[data-rt-truco-social-challenge],.rt-truco-challenge-btn){display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:8px;min-height:52px!important;min-width:160px;max-width:100%;padding:12px 16px!important;border:1px solid #d8b66a!important;border-radius:12px!important;background:linear-gradient(125deg,#182332,#47347b)!important;color:#fff0bd!important;font-size:14px!important;line-height:1.3!important;font-weight:800!important;letter-spacing:.025em;text-indent:0!important;opacity:1!important;visibility:visible!important;box-shadow:0 5px 15px #30235730;white-space:normal!important;cursor:pointer}
#buddypress .rtp-member-actions :is([data-rt-challenge-user],[data-rt-truco-social-challenge],.rt-truco-challenge-btn):disabled{opacity:.75!important;cursor:wait}
#buddypress .rtp-member-actions .rtp-challenge-button.is-sent{background:#205b43!important;color:#fff!important}
#buddypress .rtp-members-grid.is-cards{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(min(100%,270px),1fr))!important}
#buddypress .rtp-members-grid.is-compact{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(min(100%,215px),1fr))!important}
#buddypress .is-compact .rtp-member-cover{height:54px!important}
#buddypress .is-compact .rtp-member-avatar-zone{margin-top:-26px!important}
#buddypress .is-compact .rtp-member-avatar{width:72px!important;height:72px!important}
#buddypress .is-compact .rtp-member-info{padding:12px!important}
#buddypress .is-compact .rtp-member-update,#buddypress .is-compact .rtp-member-stats small{display:none!important}
#buddypress .is-compact .rtp-member-stats{margin-top:12px!important}
#buddypress .is-compact .rtp-member-name{font-size:16px!important}
#buddypress .rtp-members-grid.is-list{display:grid!important;grid-template-columns:minmax(0,1fr)!important}
#buddypress .is-list .rtp-member-card-inner{display:grid!important;grid-template-columns:84px minmax(0,1fr)!important;gap:16px!important;align-items:start;padding:16px!important}
#buddypress .is-list .rtp-member-cover{display:none!important}
#buddypress .is-list .rtp-member-avatar-zone{margin:0!important;position:static!important}
#buddypress .is-list .rtp-member-avatar{width:72px!important;height:72px!important}
#buddypress .is-list .rtp-member-info{padding:0!important;text-align:left!important;min-width:0}
#buddypress .is-list .rtp-member-stats{max-width:540px;margin:12px 0!important}
#buddypress .is-list .rtp-member-update{display:none!important}
#buddypress .is-list .rtp-member-actions,#buddypress .is-list .rtp-member-bp-buttons{flex-direction:row!important;justify-content:flex-start!important;flex-wrap:wrap!important;width:auto!important}
#buddypress .is-list .rtp-member-view{width:auto!important}
/* Red remains the challenge signal; badges are stable, readable and distinct from layout. */
.rtp-side-link.rt-truco-menu-alert,.rtp-mobile-nav a.rt-truco-menu-alert{position:relative;background:linear-gradient(115deg,#d934501c,#a5213c0b)!important;border-radius:12px;box-shadow:inset 3px 0 0 #de3657!important}
.rtp-side-link.rt-truco-menu-alert svg,.rtp-mobile-nav a.rt-truco-menu-alert svg{color:#d93251!important;animation:none!important;filter:drop-shadow(0 2px 4px #d9325133)}
.rtp-side-link.rt-truco-menu-alert:after{width:9px;height:9px;border-radius:3px;transform:rotate(45deg);animation:none!important;background:#d93251;box-shadow:0 0 0 3px #de36571c}
.rtp-side-link .rtp-menu-badge,.rtp-mobile-badge,.rtp-top-actions a>b,.rtp-top-actions button>b{display:inline-grid;place-items:center;min-width:23px;height:23px;padding:0 6px;border:1px solid #ff9bb0;border-radius:7px!important;background:linear-gradient(135deg,#c92549,#96253c)!important;color:#fff!important;font-size:12px!important;font-weight:800;line-height:1!important;font-variant-numeric:tabular-nums;box-shadow:0 2px 6px #91223b26!important;animation:none!important}
.rtp-side-link:has(.rtp-menu-badge){gap:10px}
@media(max-width:600px){#buddypress .rtp-members-grid.is-cards{grid-template-columns:minmax(0,1fr)!important}#buddypress .is-list .rtp-member-card-inner{grid-template-columns:56px minmax(0,1fr)!important;gap:12px!important;padding:12px!important}#buddypress .is-list .rtp-member-avatar{width:52px!important;height:52px!important}#buddypress .is-list .rtp-member-stats{grid-template-columns:repeat(3,minmax(0,1fr))!important}#buddypress .rtp-community-viewbuttons button span{display:inline!important}#buddypress .is-list .rtp-member-name{font-size:16px!important}}
@media(prefers-reduced-motion:reduce){.rtp-side-link.rt-truco-menu-alert,.rtp-mobile-nav a.rt-truco-menu-alert{transition:none!important}}

.rtp-mobile-nav a.rt-truco-menu-alert:before{width:9px;height:9px;border-radius:3px;transform:rotate(45deg);background:#d93251;box-shadow:0 0 0 3px #de36571c!important;animation:none!important}.rtp-mobile-nav a.rt-truco-menu-alert:after{display:none!important}
/* Profile controls keep destructive actions separate from opening a photo. */
.rtp-photo-item{display:grid;gap:8px;min-width:0;margin:0}.rtp-photo-delete{min-height:48px;padding:8px;border:1px solid #c86679;border-radius:10px;background:var(--rtp-surface);color:var(--rtp-text);font:inherit;cursor:pointer}.rtp-avatar-crop{width:min(440px,calc(100vw - 24px));max-height:90dvh;overflow:auto;padding:20px;border:1px solid var(--rtp-line);border-radius:20px;background:var(--rtp-surface);color:var(--rtp-text);box-sizing:border-box}.rtp-avatar-crop::backdrop{background:#111a}.rtp-avatar-crop form{display:grid;gap:12px}.rtp-avatar-crop h2,.rtp-avatar-crop p{margin:0}.rtp-avatar-crop canvas{display:block;width:min(100%,320px);height:auto;aspect-ratio:1;justify-self:center;border-radius:50%;touch-action:none;cursor:grab}.rtp-avatar-crop label{display:grid;gap:6px}.rtp-avatar-crop input{min-height:44px}.rtp-avatar-crop form>div{display:flex;gap:10px;flex-wrap:wrap}.rtp-avatar-crop button{flex:1;min-height:48px;padding:10px;border:1px solid var(--rtp-line);border-radius:12px;background:var(--rtp-surface-2);color:inherit;font:inherit}.rtp-avatar-crop [data-crop-save]{background:#5540bc;color:#fff}.rtp-avatar-crop button:disabled{opacity:.6}

.rtp-member-profile-stats:has(.is-chess){grid-template-columns:repeat(4,minmax(0,1fr))}.rtp-chess-challenge{min-height:52px;white-space:normal;overflow-wrap:anywhere}
@media(max-width:680px){.rtp-member-profile-stats:has(.is-chess){grid-template-columns:repeat(2,minmax(0,1fr))}}
