.rpg-hub-header-wrapper {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto 2em auto;
    min-height: 200px;
    background: #23272a;
    border-radius: 10px;
    box-shadow: 0 4px 24px -8px rgba(0,0,0,0.2);
}

.rpg-hub-header-image-clip {
    width: 100%;
    overflow: hidden;
    border-radius: 10px 10px 0 0;
}

.rpg-hub-header-image {
    width: 100%;
    max-width: 800px;
    max-height: 400px;
    object-fit: cover;
    display: block;
    margin: 0;
}

.rpg-hub-header-placeholder {
    width: 100%;
    height: 200px;
    background: #444b52;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
}

.rpg-hub-header-avatar {
    position: absolute;
    left: 32px;
    bottom: -75px; /* For 150px avatar, half is 75px */
    z-index: 10;
    width: 150px;
    height: 150px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 1px;
}

.rpg-hub-owner-avatar {
    width: 140px;
    height: 140px;
    border: 2px solid #fff;
    background: #fff;
    object-fit: cover;
    border-radius: 0;
    display: block;
}

.rpg-hub-title-bar {
    width: 100%;
    max-width: 800px;
    margin: 90px auto 1rem auto;
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.rpg-hub-title-group {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rpg-hub-meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rpg-hub-meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 9px;
    border: 1px solid #d9d2c7;
    border-radius: 999px;
    background: #f7f2ea;
    color: #2f2a24;
    font-size: 0.78rem;
    line-height: 1.2;
}

.rpg-hub-meta-badge.is-owner {
    background: #f3ede3;
}

.rpg-hub-meta-badge.is-public {
    background: #edf5ef;
    border-color: #c8ddcd;
}

.rpg-hub-meta-badge.is-private {
    background: #f5ecec;
    border-color: #dec8c8;
}

.rpg-hub-meta-badge.is-request {
    background: #f1f0f7;
    border-color: #d6d3e7;
}

.rpg-hub-meta-badge.is-invite-only {
    background: #f6eee2;
    border-color: #e4d3b8;
}

.rpg-hub-meta-badge.is-closed {
    background: #eceff1;
    border-color: #cfd7dc;
}

.rpg-hub-meta-label {
    color: #6e6252;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rpg-hub-meta-value {
    font-weight: 600;
    white-space: nowrap;
}

.rpg-hub-meta-button {
    appearance: none;
    cursor: pointer;
    font: inherit;
    background: #f7f2ea;
    color: #2f2a24;
}

.rpg-hub-meta-button .rpg-hub-meta-label {
    color: #6e6252;
}

.rpg-hub-meta-button .rpg-hub-meta-value {
    color: #2f2a24;
}

.rpg-hub-meta-button:hover,
.rpg-hub-meta-button.is-active {
    background: #1f2a33;
    border-color: #1f2a33;
    color: #fff;
}

.rpg-hub-meta-button:hover .rpg-hub-meta-label,
.rpg-hub-meta-button.is-active .rpg-hub-meta-label {
    color: #d3dee7;
}

.rpg-hub-meta-button:hover .rpg-hub-meta-value,
.rpg-hub-meta-button.is-active .rpg-hub-meta-value {
    color: #fff;
}

.rpg-hub-meta-button:focus-visible {
    outline: 2px solid #d9b06a;
    outline-offset: 2px;
}

.rpg-hub-meta-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    min-height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #1f2a33;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
}

.rpg-hub-meta-button.is-active .rpg-hub-meta-count,
.rpg-hub-meta-button:hover .rpg-hub-meta-count {
    background: #fff;
    color: #1f2a33;
}

.rpg-hub-header-gear {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1f2a33;
    border: 1px solid #1f2a33;
    border-radius: 999px;
    color: #fff;
    padding: 10px 16px;
    cursor: pointer;
    box-shadow: 0 8px 18px -12px rgba(0, 0, 0, 0.55);
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.rpg-hub-header-gear span {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
}

.rpg-hub-header-gear:hover,
.rpg-hub-header-gear.active {
    background: #11181f;
    border-color: #11181f;
    color: #fff;
    box-shadow: 0 10px 20px -12px rgba(0, 0, 0, 0.75);
}

.rpg-hub-header-gear:focus-visible {
    outline: 2px solid #d9b06a;
    outline-offset: 2px;
}

.rpg-hub-header-controls {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 1.5rem auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    background: rgba(35,39,42,0.98);
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 16px -4px rgba(0,0,0,0.35);
}

.rpg-hub-settings-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rpg-hub-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.rpg-hub-settings-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.rpg-hub-settings-label {
    color: #efe6d5;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rpg-hub-settings-field select {
    width: 100%;
    min-height: 36px;
    padding: 8px 10px;
    border: 1px solid #55616c;
    border-radius: 8px;
    background: #121920;
    color: #fff;
}

.rpg-hub-settings-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.rpg-hub-settings-status {
    min-height: 20px;
    color: #dde6ee;
    font-size: 0.88rem;
}

.rpg-hub-settings-divider {
    height: 1px;
    background: rgba(255,255,255,0.12);
}

.rpg-hub-media-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rpg-hub-media-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.rpg-hub-home-editor {
    width: 100%;
    margin: 0 auto 1.5rem auto;
    box-sizing: border-box;
    padding: 18px 20px;
    border: 1px solid #dfd7ca;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 28px -22px rgba(0, 0, 0, 0.4);
}

.rpg-hub-home-editor-intro {
    margin-bottom: 14px;
}

.rpg-hub-home-editor-intro h2 {
    margin: 0 0 4px;
    color: #1f2a33;
    font-size: 1.05rem;
    line-height: 1.2;
}

.rpg-hub-home-editor-intro p {
    margin: 0;
    color: #5a5a5a;
    font-size: 0.92rem;
}

.rpg-hub-home-editor .wp-editor-area {
    min-height: 500px;
}

.rpg-hub-home-editor .mce-edit-area iframe {
    min-height: 500px;
}

.rpg-hub-member-management {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    box-sizing: border-box;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.28s ease, opacity 0.2s ease, margin 0.28s ease;
}

.rpg-hub-member-management.is-open {
    margin: 0 auto 1.5rem auto;
}

.rpg-hub-member-management-inner {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 18px 18px;
    border-radius: 10px;
    background: rgba(35,39,42,0.98);
    box-shadow: 0 2px 16px -4px rgba(0,0,0,0.35);
}

.rpg-hub-member-management-header h2 {
    margin: 0 0 4px;
    color: #fff;
    font-size: 1.05rem;
    line-height: 1.2;
}

.rpg-hub-member-management-header p {
    margin: 0;
    color: #d7e1ea;
    font-size: 0.92rem;
}

.rpg-hub-member-management .rpg-hub-membership-grid {
    margin-top: 2px;
}

.rpg-hub-member-management .rpg-hub-membership-card {
    box-shadow: none;
}

.rpg-hub-membership {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 1.5rem auto;
    box-sizing: border-box;
}

.rpg-hub-membership-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.rpg-hub-membership-heading h2 {
    margin: 0 0 4px;
    color: #1f2a33;
    font-size: 1.05rem;
    line-height: 1.2;
}

.rpg-hub-membership-heading p {
    margin: 0;
    color: #5a5a5a;
    font-size: 0.92rem;
}

.rpg-hub-membership-notice {
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #d7d2c8;
    background: #f7f2ea;
    color: #2f2a24;
    box-shadow: 0 10px 24px -22px rgba(0, 0, 0, 0.4);
}

.rpg-hub-membership-notice.is-success {
    background: #edf5ef;
    border-color: #c8ddcd;
    color: #22402a;
}

.rpg-hub-membership-notice.is-info {
    background: #f1f0f7;
    border-color: #d6d3e7;
    color: #342f54;
}

.rpg-hub-membership-notice.is-error {
    background: #f8eded;
    border-color: #e2c8c8;
    color: #6b2d2d;
}

.rpg-hub-membership-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.rpg-hub-membership-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 20px;
    border: 1px solid #dfd7ca;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 28px -22px rgba(0, 0, 0, 0.4);
}

.rpg-hub-membership-card.is-single {
    max-width: 800px;
}

.rpg-hub-membership-card h3,
.rpg-hub-pending-email-invites h4 {
    margin: 0;
    color: #1f2a33;
    font-size: 0.98rem;
    line-height: 1.3;
}

.rpg-hub-membership-empty,
.rpg-hub-membership-help {
    margin: 0;
    color: #5a5a5a;
    font-size: 0.92rem;
}

.rpg-hub-membership-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rpg-hub-membership-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid #ebe4d9;
    border-radius: 10px;
    background: #fcfaf6;
}

.rpg-hub-membership-item.is-compact {
    padding: 10px 12px;
}

.rpg-hub-membership-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.rpg-hub-membership-copy strong {
    color: #1f2a33;
    font-size: 0.95rem;
}

.rpg-hub-membership-copy span {
    color: #5a5a5a;
    font-size: 0.88rem;
    line-height: 1.4;
    word-break: break-word;
}

.rpg-hub-membership-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.rpg-hub-membership-action-form,
.rpg-hub-membership-form {
    margin: 0;
}

.rpg-hub-membership-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rpg-hub-membership-form label {
    color: #1f2a33;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rpg-hub-membership-form select,
.rpg-hub-membership-form input[type="email"] {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid #d7cec2;
    border-radius: 8px;
    background: #fff;
    color: #2f2a24;
    box-sizing: border-box;
}

.rpg-hub-membership-divider {
    height: 1px;
    background: #ebe4d9;
}

.rpg-hub-membership .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 999px;
    text-decoration: none;
}

.rpg-hub-membership .button.button-primary {
    background: #1f2a33;
    border: 1px solid #1f2a33;
    color: #fff;
}

.rpg-hub-membership .button.button-secondary {
    background: #f3ede3;
    border: 1px solid #d9d2c7;
    color: #2f2a24;
}

.rpg-hub-membership .button[disabled],
.rpg-hub-membership-form select:disabled,
.rpg-hub-membership-form input[type="email"]:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.rpg-hub-pending-email-invites {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rpg-hub-header-controls .button {
    font-size: 1em;
    padding: 4px 14px;
}

.rpg-hub-header-note {
    font-size: 0.9em;
    color: #eee;
    flex-basis: 100%;
    margin-top: 2px;
    text-align: left;
}

.rpg-hub-home h1 {
    margin: 0;
}

@media (max-width: 640px) {
    .rpg-hub-title-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .rpg-hub-meta-bar {
        gap: 6px;
    }

    .rpg-hub-settings-grid {
        grid-template-columns: 1fr;
    }

    .rpg-hub-membership-grid {
        grid-template-columns: 1fr;
    }

    .rpg-hub-member-management-inner {
        padding: 14px 16px 16px;
    }

    .rpg-hub-membership-item {
        flex-direction: column;
    }

    .rpg-hub-membership-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .rpg-hub-header-gear {
        width: 100%;
        justify-content: center;
    }
}