.admin-page-wrap {
    width: min(1680px, calc(100vw - 48px));
    margin: 0 auto;
    padding: 32px 0 72px;
    color: var(--text, #f3f4f6);
}

.admin-card {
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 24px;
    background: rgba(20, 24, 32, 0.92);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
    padding: 26px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 18px;
}

.admin-kicker {
    margin: 0 0 6px;
    color: #f2ad22;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-header h1 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(30px, 3.2vw, 46px);
    line-height: 1.08;
}

.admin-status {
    margin: 0 0 18px;
    color: rgba(255, 255, 255, 0.72);
    font-weight: 800;
}

.admin-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    min-width: 1180px;
    border-collapse: collapse;
    table-layout: fixed;
}

.admin-table th,
.admin-table td {
    padding: 15px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    color: #f2ad22;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.admin-table th:nth-child(1),
.admin-table td:nth-child(1) {
    width: 150px;
}

.admin-table th:nth-child(2),
.admin-table td:nth-child(2) {
    width: 260px;
}

.admin-table th:nth-child(3),
.admin-table td:nth-child(3) {
    width: 360px;
}

.admin-table th:nth-child(4),
.admin-table td:nth-child(4) {
    width: 390px;
}

.admin-table th:nth-child(5),
.admin-table td:nth-child(5) {
    width: 160px;
    text-align: right;
}

.admin-table td:nth-child(1),
.admin-table td:nth-child(2) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
}

.admin-role-grid {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    min-width: 0;
    min-height: 38px;
    vertical-align: middle;
}

.admin-role-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 38px;
    min-height: 38px;
    padding: 0 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.075);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-weight: 900;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    margin: 0;
}

.admin-role-option input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #f2ad22;
}

/* Wichtig:
   .admin-games-actions-cell ist direkt die TD.
   Deshalb NICHT display:flex auf der TD setzen. */
.admin-table td.admin-games-actions-cell {
    display: table-cell;
    vertical-align: middle;
    white-space: nowrap;
    padding-top: 15px;
    padding-bottom: 15px;
    transform: none;
}

.admin-btn {
    border: 0;
    border-radius: 13px;
    height: 38px;
    min-height: 38px;
    padding: 0 13px;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.admin-btn-primary {
    background: #f2ad22;
    color: #111827;
}

.admin-btn-secondary {
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.admin-btn:hover {
    filter: brightness(1.06);
}

.admin-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.admin-table td.admin-games-actions-cell .admin-btn {
    margin: 0 8px 0 0;
}

.admin-table td.admin-games-actions-cell .admin-btn:last-child {
    margin-right: 0;
}

.admin-table td:nth-child(5) .admin-btn {
    min-width: 128px;
}

.admin-table td:nth-child(3),
.admin-table td:nth-child(4),
.admin-table td:nth-child(5) {
    vertical-align: middle;
}

/* Modal */

.admin-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.68);
    backdrop-filter: blur(8px);
}

.admin-modal-backdrop[hidden] {
    display: none !important;
}

.admin-modal-dialog {
    width: min(1080px, calc(100vw - 32px));
    max-height: min(860px, calc(100vh - 32px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 24px;
    background: rgba(20, 24, 32, 0.98);
    border: 1px solid rgba(242, 173, 34, 0.35);
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.62);
    color: #ffffff;
}

.admin-modal-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.admin-modal-header h2 {
    margin: 0;
    font-size: 30px;
    color: #ffffff;
}

.admin-modal-subtitle {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, 0.68);
    font-weight: 800;
}

.admin-modal-close {
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 999px;
    background: #f2ad22;
    color: #111827;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.admin-games-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    padding: 16px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.admin-games-toolbar input {
    min-width: 0;
    height: 42px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    padding: 0 14px;
    outline: none;
    font-weight: 800;
}

.admin-games-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 22px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.admin-game-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
        "check title"
        "check meta";
    gap: 2px 10px;
    align-items: center;
    min-width: 0;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.10);
    cursor: pointer;
}

.admin-game-option input {
    grid-area: check;
    accent-color: #f2ad22;
}

.admin-game-title {
    grid-area: title;
    min-width: 0;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-game-meta {
    grid-area: meta;
    min-width: 0;
    color: rgba(255, 255, 255, 0.58);
    font-weight: 700;
}

.admin-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
}

/* Lightmode */

body.light-mode .admin-card,
html[data-theme="light"] .admin-card {
    background: rgba(255, 255, 255, 0.94);
    color: #111827;
    border-color: rgba(17, 24, 39, 0.14);
}

body.light-mode .admin-header h1,
html[data-theme="light"] .admin-header h1 {
    color: #111827;
}

body.light-mode .admin-status,
html[data-theme="light"] .admin-status {
    color: #4b5563;
}

body.light-mode .admin-table th,
html[data-theme="light"] .admin-table th {
    color: #a16207;
}

body.light-mode .admin-table td,
body.light-mode .admin-table th,
html[data-theme="light"] .admin-table td,
html[data-theme="light"] .admin-table th {
    border-bottom-color: rgba(17, 24, 39, 0.12);
}

body.light-mode .admin-role-option,
html[data-theme="light"] .admin-role-option {
    background: rgba(17, 24, 39, 0.06);
    border-color: rgba(17, 24, 39, 0.12);
    color: #111827;
}

body.light-mode .admin-btn-secondary,
html[data-theme="light"] .admin-btn-secondary {
    background: rgba(17, 24, 39, 0.08);
    color: #111827;
    border-color: rgba(17, 24, 39, 0.12);
}

body.light-mode .admin-modal-dialog,
html[data-theme="light"] .admin-modal-dialog {
    background: rgba(255, 255, 255, 0.98);
    color: #111827;
}

body.light-mode .admin-modal-header h2,
html[data-theme="light"] .admin-modal-header h2 {
    color: #111827;
}

body.light-mode .admin-modal-subtitle,
html[data-theme="light"] .admin-modal-subtitle {
    color: #4b5563;
}

body.light-mode .admin-games-toolbar input,
html[data-theme="light"] .admin-games-toolbar input {
    background: rgba(17, 24, 39, 0.06);
    color: #111827;
    border-color: rgba(17, 24, 39, 0.14);
}

body.light-mode .admin-game-option,
html[data-theme="light"] .admin-game-option {
    background: rgba(17, 24, 39, 0.055);
    border-color: rgba(17, 24, 39, 0.12);
}

body.light-mode .admin-game-meta,
html[data-theme="light"] .admin-game-meta {
    color: #6b7280;
}

/* Responsive */

@media (min-width: 1500px) {
    .admin-page-wrap {
        width: min(1760px, calc(100vw - 64px));
    }

    .admin-table {
        min-width: 1320px;
    }

    .admin-table th:nth-child(1),
    .admin-table td:nth-child(1) {
        width: 180px;
    }

    .admin-table th:nth-child(2),
    .admin-table td:nth-child(2) {
        width: 300px;
    }

    .admin-table th:nth-child(3),
    .admin-table td:nth-child(3) {
        width: 390px;
    }

    .admin-table th:nth-child(4),
    .admin-table td:nth-child(4) {
        width: 430px;
    }

    .admin-table th:nth-child(5),
    .admin-table td:nth-child(5) {
        width: 180px;
    }
}

@media (max-width: 1280px) {
    .admin-page-wrap {
        width: min(1280px, calc(100vw - 32px));
    }

    .admin-table {
        min-width: 1120px;
    }

    .admin-role-grid {
        flex-wrap: wrap;
    }

    .admin-table td.admin-games-actions-cell {
        white-space: normal;
    }

    .admin-table td.admin-games-actions-cell .admin-btn {
        margin-bottom: 8px;
    }
}

@media (max-width: 760px) {
    .admin-page-wrap {
        width: calc(100vw - 20px);
        padding-top: 18px;
    }

    .admin-card {
        padding: 18px;
        border-radius: 20px;
    }

    .admin-header {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-header .admin-btn {
        width: 100%;
    }

    .admin-table {
        min-width: 980px;
    }

    .admin-games-toolbar {
        grid-template-columns: 1fr;
    }

    .admin-games-list {
        grid-template-columns: 1fr;
    }
}

/* Aktiver Spielrechte-Status */
.admin-table td.admin-games-actions-cell .admin-btn.admin-btn-active {
    background: #f2ad22 !important;
    color: #111827 !important;
    border-color: #f2ad22 !important;
    box-shadow:
        0 0 0 2px rgba(242, 173, 34, 0.22),
        0 8px 22px rgba(242, 173, 34, 0.18);
}

.admin-table td.admin-games-actions-cell .admin-btn.admin-btn-active:hover {
    filter: brightness(1.04);
}

body.light-mode .admin-table td.admin-games-actions-cell .admin-btn.admin-btn-active,
html[data-theme="light"] .admin-table td.admin-games-actions-cell .admin-btn.admin-btn-active {
    background: #f2ad22 !important;
    color: #111827 !important;
    border-color: #f2ad22 !important;
}

.admin-game-logo-missing {
    position: relative;
    background:
        linear-gradient(135deg, rgba(242, 173, 34, 0.18), rgba(255, 255, 255, 0.04)) !important;
}

.admin-game-logo-missing::after {
    content: "🎮";
}

.admin-game-option {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    min-height: 140px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.10);
    cursor: pointer;
    overflow: hidden;
}

.admin-game-option input[type="checkbox"] {
    justify-self: start;
    align-self: center;
    margin: 0;
    accent-color: #f2ad22;
}

.admin-game-logo {
    width: 100%;
    max-width: 120px;
    height: 84px;
    max-height: 84px;
    display: block;
    object-fit: contain;
    object-position: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    padding: 6px;
    overflow: hidden;
}

.admin-game-logo-missing {
    width: 100%;
    max-width: 120px;
    height: 84px;
    max-height: 84px;
    display: block;
    object-fit: contain;
    object-position: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04) !important;
    padding: 6px;
    overflow: hidden;
}

.admin-game-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.admin-game-title {
    font-weight: 900;
    color: #fff;
    line-height: 1.25;
    word-break: break-word;
}

.admin-game-meta {
    color: rgba(255, 255, 255, 0.58);
    font-weight: 700;
    line-height: 1.2;
}

body.light-mode .admin-game-logo,
html[data-theme="light"] .admin-game-logo,
body.light-mode .admin-game-logo-missing,
html[data-theme="light"] .admin-game-logo-missing {
    background: rgba(17, 24, 39, 0.05) !important;
}

@media (max-width: 760px) {
    .admin-game-option {
        grid-template-columns: 88px minmax(0, 1fr);
        min-height: 112px;
        gap: 12px;
        padding: 12px;
    }

    .admin-game-logo,
    .admin-game-logo-missing {
        height: 100px;
        max-height: 100px;
        padding: 4px;
    }
}

/* =========================================================
   Admin-Tabelle: E-Mail-Spalte ausblenden und Platz neu verteilen
   ========================================================= */

.admin-page-wrap {
    width: min(1840px, calc(100vw - 48px)) !important;
}

.admin-table {
    min-width: 1220px !important;
    table-layout: fixed !important;
}

/* Neue Spaltenverteilung:
   1 Benutzer
   3 Rollen
   4 Spiele
   5 Aktion
*/
.admin-table th:nth-child(1),
.admin-table td:nth-child(1) {
    width: 150px !important;
}

.admin-table th:nth-child(3),
.admin-table td:nth-child(3) {
    width: 420px !important;
}

.admin-table th:nth-child(4),
.admin-table td:nth-child(4) {
    width: 440px !important;
}

.admin-table th:nth-child(5),
.admin-table td:nth-child(5) {
    width: 180px !important;
    text-align: right !important;
}

/* Rollen kompakter halten */
.admin-role-grid {
    display: inline-flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 7px !important;
    white-space: nowrap !important;
}

.admin-role-option {
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 10px !important;
    gap: 6px !important;
    font-size: 14px !important;
}

.admin-role-option input {
    width: 15px !important;
    height: 15px !important;
}

/* Spiele-Buttons kompakter und ohne Überlappung */
.admin-table td.admin-games-actions-cell {
    white-space: nowrap !important;
    overflow: visible !important;
}

.admin-table td.admin-games-actions-cell .admin-btn {
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 11px !important;
    margin-right: 6px !important;
    font-size: 14px !important;
}

.admin-table td.admin-games-actions-cell .admin-btn:last-child {
    margin-right: 0 !important;
}

/* Rollen-Speichern kompakter */
.admin-table td:nth-child(5) .admin-btn {
    min-width: 140px !important;
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 12px !important;
    font-size: 14px !important;
}

/* Bei mittleren Breiten lieber horizontal scrollen statt überlappen */
@media (max-width: 1280px) {
    .admin-table {
        min-width: 1200px !important;
    }

    .admin-role-grid {
        flex-wrap: nowrap !important;
    }

    .admin-table td.admin-games-actions-cell {
        white-space: nowrap !important;
    }

    .admin-table td.admin-games-actions-cell .admin-btn {
        margin-bottom: 0 !important;
    }
}

/* =========================================================
   Admin-Tabelle:
   Ab <1700px darf Rollen/Spiele mehrzeilig werden
   ========================================================= */

@media (max-width: 1700px) {
    .admin-table {
        min-width: 1180px !important;
        table-layout: fixed !important;
    }

    .admin-table th:nth-child(1),
    .admin-table td:nth-child(1) {
        width: 150px !important;
    }

    .admin-table th:nth-child(3),
    .admin-table td:nth-child(3) {
        width: 360px !important;
    }

    .admin-table th:nth-child(4),
    .admin-table td:nth-child(4) {
        width: 360px !important;
    }

    .admin-table th:nth-child(5),
    .admin-table td:nth-child(5) {
        width: 170px !important;
    }

    .admin-role-grid {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        align-content: center !important;
        gap: 7px !important;
        white-space: normal !important;
        min-height: 38px !important;
    }

    .admin-table td.admin-games-actions-cell {
        white-space: normal !important;
        vertical-align: middle !important;
    }

    .admin-table td.admin-games-actions-cell .admin-btn {
        margin: 0 6px 6px 0 !important;
    }

    .admin-table td.admin-games-actions-cell .admin-btn:last-child {
        margin-right: 0 !important;
    }

    .admin-table td:nth-child(5) {
        vertical-align: middle !important;
    }
}

/* Unter 1300px noch etwas kompakter */
@media (max-width: 1300px) {
    .admin-table {
        min-width: 1080px !important;
    }

    .admin-table th:nth-child(1),
    .admin-table td:nth-child(1) {
        width: 140px !important;
    }

    .admin-table th:nth-child(3),
    .admin-table td:nth-child(3) {
        width: 320px !important;
    }

    .admin-table th:nth-child(4),
    .admin-table td:nth-child(4) {
        width: 340px !important;
    }

    .admin-table th:nth-child(5),
    .admin-table td:nth-child(5) {
        width: 160px !important;
    }

    .admin-role-option,
    .admin-table td.admin-games-actions-cell .admin-btn,
    .admin-table td:nth-child(5) .admin-btn {
        height: 34px !important;
        min-height: 34px !important;
        font-size: 13px !important;
    }
}

/* =========================================================
   ADMIN Rollenlayout Fix für background_remove
   ========================================================= */

.admin-table {
    min-width: 1420px !important;
    table-layout: fixed !important;
}

/* E-Mail bleibt ausgeblendet */
.admin-table th:nth-child(2),
.admin-table td:nth-child(2) {
    display: none !important;
}

/* Spalten neu verteilen */
.admin-table th:nth-child(1),
.admin-table td:nth-child(1) {
    width: 150px !important;
}

.admin-table th:nth-child(3),
.admin-table td:nth-child(3) {
    width: 560px !important;
}

.admin-table th:nth-child(4),
.admin-table td:nth-child(4) {
    width: 430px !important;
}

.admin-table th:nth-child(5),
.admin-table td:nth-child(5) {
    width: 170px !important;
    text-align: right !important;
}

/* Rollen dürfen immer umbrechen */
.admin-role-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    align-content: center !important;
    gap: 7px !important;
    white-space: normal !important;
    min-width: 0 !important;
    max-width: 100% !important;
}

/* Rollen-Chips kompakter */
.admin-role-option {
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 9px !important;
    gap: 6px !important;
    font-size: 13px !important;
    line-height: 1 !important;
    max-width: 150px !important;
}

.admin-role-option input {
    width: 15px !important;
    height: 15px !important;
    flex: 0 0 auto !important;
}

/* Spiele-Spalte bleibt sauber */
.admin-table td.admin-games-actions-cell {
    white-space: normal !important;
    overflow: visible !important;
    vertical-align: middle !important;
}

.admin-table td.admin-games-actions-cell .admin-btn {
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 10px !important;
    margin: 0 6px 6px 0 !important;
    font-size: 13px !important;
}

/* Aktionsbutton kompakter */
.admin-table td:nth-child(5) .admin-btn {
    min-width: 132px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 10px !important;
    font-size: 13px !important;
}

/* Falls der Platz nicht reicht: horizontal scrollen statt überlappen */
.admin-table-wrap {
    overflow-x: auto !important;
    overflow-y: visible !important;
}

/* =========================================================
   ADMIN Tabelle: Benutzer / E-Mail-Adresse / Rollen / Spiele
   Keine Aktion-Spalte mehr
   ========================================================= */

.admin-page-wrap {
    width: min(1840px, calc(100vw - 48px)) !important;
}

.admin-table {
    min-width: 1320px !important;
    table-layout: fixed !important;
}

/* Spalten:
   1 Benutzer
   2 E-Mail-Adresse
   3 Rollen
   4 Spiele
*/
.admin-table th:nth-child(1),
.admin-table td:nth-child(1) {
    width: 170px !important;
}

.admin-table th:nth-child(2),
.admin-table td:nth-child(2) {
    display: table-cell !important;
    width: 300px !important;
}

.admin-table th:nth-child(3),
.admin-table td:nth-child(3) {
    width: 500px !important;
}

.admin-table th:nth-child(4),
.admin-table td:nth-child(4) {
    width: 430px !important;
}

/* Falls alte Regeln für die frühere Aktion-Spalte existieren */
.admin-table th:nth-child(5),
.admin-table td:nth-child(5) {
    display: none !important;
}

/* Benutzer und E-Mail sauber kürzen */
.admin-table td:nth-child(1),
.admin-table td:nth-child(2) {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-weight: 800;
}

/* Rollen dürfen umbrechen, damit nichts in Spiele reinläuft */
.admin-role-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    align-content: center !important;
    gap: 7px !important;
    white-space: normal !important;
    min-width: 0 !important;
    max-width: 100% !important;
}

.admin-role-option {
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 9px !important;
    gap: 6px !important;
    font-size: 13px !important;
    line-height: 1 !important;
    max-width: 160px !important;
}

/* Spiele-Buttons dürfen ebenfalls umbrechen */
.admin-table td.admin-games-actions-cell {
    white-space: normal !important;
    overflow: visible !important;
    vertical-align: middle !important;
}

.admin-table td.admin-games-actions-cell .admin-btn {
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 10px !important;
    margin: 0 6px 6px 0 !important;
    font-size: 13px !important;
}

.admin-table-wrap {
    overflow-x: auto !important;
    overflow-y: visible !important;
}

@media (max-width: 1450px) {
    .admin-table {
        min-width: 1260px !important;
    }

    .admin-table th:nth-child(1),
    .admin-table td:nth-child(1) {
        width: 150px !important;
    }

    .admin-table th:nth-child(2),
    .admin-table td:nth-child(2) {
        width: 260px !important;
    }

    .admin-table th:nth-child(3),
    .admin-table td:nth-child(3) {
        width: 470px !important;
    }

    .admin-table th:nth-child(4),
    .admin-table td:nth-child(4) {
        width: 380px !important;
    }
}

/* =========================================================
   ADMIN TABLE LAYOUT
   Alles pro Benutzer in genau einer Zeile
   ========================================================= */

.admin-page-wrap {
    width: min(1920px, calc(100vw - 32px)) !important;
    margin: 0 auto !important;
}

.admin-card {
    width: 100% !important;
}

.admin-table-wrap {
    overflow-x: auto !important;
    overflow-y: visible !important;
}

.admin-table {
    width: 100% !important;
    min-width: 1620px !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
}

/* 4 sichtbare Spalten:
   1 Benutzer
   2 E-Mail-Adresse
   3 Rollen
   4 Spiele
*/
.admin-table th:nth-child(1),
.admin-table td:nth-child(1) {
    width: 180px !important;
}

.admin-table th:nth-child(2),
.admin-table td:nth-child(2) {
    width: 330px !important;
}

.admin-table th:nth-child(3),
.admin-table td:nth-child(3) {
    width: 620px !important;
}

.admin-table th:nth-child(4),
.admin-table td:nth-child(4) {
    width: 370px !important;
}

/* Falls noch alte 5. Spalte-Reste existieren */
.admin-table th:nth-child(5),
.admin-table td:nth-child(5) {
    display: none !important;
}

.admin-table th,
.admin-table td {
    vertical-align: middle !important;
}

/* Benutzer + E-Mail nicht umbrechen */
.admin-table td:nth-child(1),
.admin-table td:nth-child(2) {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Rollen: IMMER in einer Zeile */
.admin-role-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 6px !important;
    white-space: nowrap !important;
    overflow: visible !important;
    min-width: 0 !important;
    max-width: none !important;
}

.admin-role-option {
    flex: 0 0 auto !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 9px !important;
    gap: 6px !important;
    font-size: 13px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    max-width: none !important;
}

.admin-role-option input {
    width: 15px !important;
    height: 15px !important;
    flex: 0 0 auto !important;
}

/* Spiele-Spalte: auch nur eine Zeile */
.admin-table td.admin-games-actions-cell {
    white-space: nowrap !important;
    overflow: visible !important;
}

.admin-table td.admin-games-actions-cell .admin-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 10px !important;
    margin: 0 6px 0 0 !important;
    font-size: 13px !important;
}

/* Falls Buttons allgemein zu groß sind */
.admin-btn {
    white-space: nowrap !important;
}

/* Etwas kompakter bei kleineren Desktop-Breiten */
@media (max-width: 1750px) {
    .admin-table {
        min-width: 1540px !important;
    }

    .admin-table th:nth-child(1),
    .admin-table td:nth-child(1) {
        width: 165px !important;
    }

    .admin-table th:nth-child(2),
    .admin-table td:nth-child(2) {
        width: 290px !important;
    }

    .admin-table th:nth-child(3),
    .admin-table td:nth-child(3) {
        width: 590px !important;
    }

    .admin-table th:nth-child(4),
    .admin-table td:nth-child(4) {
        width: 340px !important;
    }

    .admin-role-option {
        padding: 0 8px !important;
        font-size: 12.5px !important;
    }

    .admin-table td.admin-games-actions-cell .admin-btn {
        padding: 0 9px !important;
        font-size: 12.5px !important;
    }
}

/* =========================================================
   ADMIN - Emulator Game Modal Click-Fix
   ========================================================= */

#admin-games-modal.admin-modal-backdrop {
    position: fixed !important;
    inset: 0 !important;
    z-index: 99999 !important;
    pointer-events: auto !important;
}

#admin-games-modal .admin-modal-dialog {
    position: relative !important;
    z-index: 100000 !important;
    display: flex !important;
    flex-direction: column !important;
    max-height: 82vh !important;
    overflow: hidden !important;
    pointer-events: auto !important;
}

#admin-games-modal .admin-modal-header,
#admin-games-modal .admin-games-toolbar,
#admin-games-modal .admin-modal-footer {
    flex: 0 0 auto !important;
}

#admin-games-modal .admin-games-list {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    position: relative !important;
    z-index: 1 !important;
}

#admin-games-modal .admin-modal-footer {
    position: relative !important;
    z-index: 20 !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    padding: 16px 18px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.10) !important;
    background: rgba(24, 27, 32, 0.98) !important;
    pointer-events: auto !important;
}

#admin-games-modal #admin-games-save,
#admin-games-modal #admin-games-cancel {
    position: relative !important;
    z-index: 30 !important;
    pointer-events: auto !important;
}