/* =========================================================
   GEMEINSAME GRUNDLAGEN
========================================================= */
.rpg_crime_wrapper {
    margin: 6px 0;
}

.rpg_crime_body {
    padding: 12px !important;
}

.rpg_crime_back_link {
    margin-bottom: 8px;
    font-size: 0.9em;
}

.rpg_crime_back_link a {
    text-decoration: none;
    opacity: 0.8;
}

.rpg_crime_back_link a:hover {
    opacity: 1;
}

.rpg_crime_empty {
    text-align: center;
    padding: 40px 20px;
    opacity: 0.7;
    font-style: italic;
}

/* Type-Badge - identisch in Übersicht und Detail */
.rpg_crime_type_badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 3px;
    color: #fff;
    font-weight: 600;
    font-size: 0.85em;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}


/* =========================================================
   ÜBERSICHTS-SEITE: Karten-Grid
========================================================= */
.rpg_crime_grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.rpg_crime_card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.rpg_crime_card_image_wrap {
    width: 100%;
    height: 140px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(127, 127, 127, 0.1);
}

.rpg_crime_card_image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rpg_crime_card_image_empty {
    color: rgba(127, 127, 127, 0.7);
    font-size: 0.85em;
    font-style: italic;
}

.rpg_crime_card_body {
    padding: 10px 14px 14px;
}

.rpg_crime_card_title {
    margin: 0 0 6px 0;
    font-size: 1.05em;
    line-height: 1.3;
}

.rpg_crime_card_title a {
    text-decoration: none;
}

.rpg_crime_card_meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 4px 0 8px;
    font-size: 0.85em;
}

.rpg_crime_card_count {
    opacity: 0.7;
    font-size: 0.9em;
}

.rpg_crime_card_desc {
    font-size: 0.9em;
    line-height: 1.4;
    margin: 6px 0 0;
    opacity: 0.85;
}


/* =========================================================
   DETAIL-SEITE: Org-Header
========================================================= */
.rpg_crime_view_header {
    margin-bottom: 8px;
}

.rpg_crime_view_body {
    padding: 16px !important;
}

.rpg_crime_view_meta {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.rpg_crime_view_image_wrap {
    flex: 0 0 200px;
    max-width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 4px;
    background: rgba(127, 127, 127, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rpg_crime_view_image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rpg_crime_view_image_empty {
    color: rgba(127, 127, 127, 0.7);
    font-size: 0.9em;
    font-style: italic;
}

.rpg_crime_view_info {
    flex: 1;
    min-width: 250px;
}

.rpg_crime_view_meta_row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 0 0 12px;
    font-size: 0.9em;
}

.rpg_crime_view_founded {
    opacity: 0.75;
}

.rpg_crime_view_total_members {
    opacity: 0.75;
}

.rpg_crime_view_desc {
    line-height: 1.5;
    margin-top: 8px;
}


/* =========================================================
   DETAIL-SEITE: Rollen als Sub-Sektionen mit Karten-Grid
========================================================= */
.rpg_crime_roles_wrap {
    margin-top: 12px;
}

/* ----- Haupt-Sektion ("Hauptrollen", "Untergeordnet") ----- */
.rpg_crime_section {
    margin-bottom: 24px;
}

.rpg_crime_section_title {
    margin: 0 0 14px;
    padding: 6px 0 6px 12px;
    font-size: 1em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-left: 3px solid rgba(127, 127, 127, 0.4);
    opacity: 0.85;
}

/* ----- Sub-Sektion pro Rolle (Header mit Name+Slot+Beschreibung, dann Karten-Grid) ----- */
.rpg_crime_role_section {
    margin-bottom: 18px;
    padding-left: 12px;
}

.rpg_crime_role_section_header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.rpg_crime_role_section_title {
    margin: 0;
    font-size: 1.05em;
    line-height: 1.3;
}

.rpg_crime_role_section_slot {
    font-size: 0.85em;
    opacity: 0.65;
    white-space: nowrap;
}

.rpg_crime_role_section_desc {
    font-size: 0.9em;
    line-height: 1.45;
    opacity: 0.85;
    margin: 0 0 10px;
}

.rpg_crime_card_grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}


/* ----- Eine einzelne Karte (kompakt: Bild + Action) ----- */
.rpg_crime_rolecard {
    display: flex;
    flex-direction: column;
    background: rgba(127, 127, 127, 0.06);
    border: 1px solid rgba(127, 127, 127, 0.2);
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.15s;
}

.rpg_crime_rolecard:hover {
    border-color: rgba(127, 127, 127, 0.4);
}

/* Modifier: User selbst ist aktives Mitglied */
.rpg_crime_rolecard.is-mine {
    border-color: rgba(34, 139, 34, 0.5);
    box-shadow: 0 0 0 1px rgba(34, 139, 34, 0.15) inset;
}

/* Modifier: User ist pending in dieser Rolle (eigene Karte) */
.rpg_crime_rolecard.is-pending {
    border-color: rgba(218, 165, 32, 0.5);
}


/* ----- Bild-Bereich der Karte ----- */
.rpg_crime_rolecard_image {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(127, 127, 127, 0.1);
    position: relative;
}

.rpg_crime_rolecard_image_img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Avatar-Variante (User-Karte / Pending-Karte): rund, zentriert, mit Caption */
.rpg_crime_rolecard_image_link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    gap: 8px;
    padding: 12px 8px;
}

.rpg_crime_rolecard_image_avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 3px solid rgba(127, 127, 127, 0.25);
    object-fit: cover;
    flex: 0 0 auto;
}

.rpg_crime_rolecard_image_caption {
    font-size: 0.9em;
    font-weight: 600;
    text-align: center;
    word-break: break-word;
}

.rpg_crime_rolecard_image_empty {
    color: rgba(127, 127, 127, 0.7);
    font-size: 0.85em;
    font-style: italic;
}


/* ----- Karten-Body (nur noch Action-Block) ----- */
.rpg_crime_rolecard_body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    flex: 1;
}


/* ----- Action-Bereich ----- */
.rpg_crime_rolecard_action_static {
    text-align: center;
    padding: 7px 12px;
    background: rgba(127, 127, 127, 0.1);
    border-radius: 3px;
    font-size: 0.85em;
    font-style: italic;
    opacity: 0.75;
}

.rpg_crime_rolecard_action_pending {
    background: rgba(218, 165, 32, 0.15);
    color: rgb(150, 110, 0);
    font-style: normal;
    opacity: 1;
}


/* ----- Buttons (Übernehmen / Verlassen) ----- */
.rpg_crime_btn {
    display: block;
    width: 100%;
    padding: 7px 12px;
    border: 1px solid rgba(127, 127, 127, 0.3);
    border-radius: 3px;
    background: rgba(127, 127, 127, 0.08);
    color: inherit;
    font-size: 0.85em;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    font-family: inherit;
}

.rpg_crime_btn:hover {
    background: rgba(127, 127, 127, 0.18);
    border-color: rgba(127, 127, 127, 0.5);
}

.rpg_crime_btn_join {
    border-color: rgba(34, 139, 34, 0.4);
    background: rgba(34, 139, 34, 0.08);
}

.rpg_crime_btn_join:hover {
    background: rgba(34, 139, 34, 0.18);
    border-color: rgba(34, 139, 34, 0.6);
}

.rpg_crime_btn_leave {
    border-color: rgba(178, 34, 34, 0.35);
    background: rgba(178, 34, 34, 0.06);
}

.rpg_crime_btn_leave:hover {
    background: rgba(178, 34, 34, 0.15);
    border-color: rgba(178, 34, 34, 0.55);
}


/* ----- Admin-Aktionen (Annehmen / Ablehnen nebeneinander) ----- */
.rpg_crime_rolecard_action_admin {
    display: flex;
    gap: 6px;
}

.rpg_crime_admin_form {
    flex: 1;
}

.rpg_crime_btn_approve {
    border-color: rgba(34, 139, 34, 0.4);
    background: rgba(34, 139, 34, 0.08);
}

.rpg_crime_btn_approve:hover {
    background: rgba(34, 139, 34, 0.18);
    border-color: rgba(34, 139, 34, 0.6);
}

.rpg_crime_btn_reject {
    border-color: rgba(178, 34, 34, 0.35);
    background: rgba(178, 34, 34, 0.06);
}

.rpg_crime_btn_reject:hover {
    background: rgba(178, 34, 34, 0.15);
    border-color: rgba(178, 34, 34, 0.55);
}