/* Grundlayout */
* {
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", sans-serif;
    margin: 0;
    background-color: var(--page-bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
}

header {
    background: var(--primary);
    color: #ffffff;
    padding: 1em;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

h1 {
    margin: 0 0 .7em 0;
    font-size: 2em;
}

main {
    padding: 1em;
    max-width: 1000px;
    margin: 0 auto;
}

section {
    background-color: var(--card-bg);
    border-left: 5px solid var(--primary);
    margin-bottom: 1.5em;
    padding: 1em;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Überschriften */
h2 {
    color: var(--primary);
    margin-top: 0;
    font-size: 1.3em;
}

h3 {
    color: #244174;
    margin-bottom: .6em;
}

/* Navigation */
.topnav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5em;
}

.topnav a,
.admin-menu a,
.button-link {
    display: inline-block;
    padding: .75em 1em;
    background-color: var(--card-bg);
    color: var(--primary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
}

.admin-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1em;
}

.admin-menu a,
.button-link {
    background-color: var(--primary);
    color: #ffffff;
    text-align: center;
}

.topnav a:hover,
.admin-menu a:hover,
.button-link:hover,
button:hover {
    filter: brightness(0.9);
}

/* Formulare */
form {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

label {
    font-weight: 600;
}

input[type="text"],
input[type="number"],
select,
button {
    width: 100%;
    padding: .75em;
    font-size: 1em;
    border: 1px solid #ccd5e3;
    border-radius: 8px;
}

button {
    background-color: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 700;
}

/* Hinweise */
.success {
    background: #e5f7ea;
    border-left: 5px solid #2e8b57;
    padding: .8em;
    border-radius: 8px;
}

.warning {
    background: #fff3cd;
    border-left: 5px solid #d39e00;
    padding: .8em;
    border-radius: 8px;
}

.notice {
    background: #eef4ff;
}

/* Frontend Highlights */
.reload-box {
    text-align: right;
    margin-bottom: 1em;
    font-size: .95em;
}

.highlight-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1em;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
}

.highlight-card {
    background: #ffffff;
    border-left: 5px solid var(--primary);
    padding: 1em;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.big-match {
    font-size: 1.35em;
    font-weight: 800;
}

.big-match span {
    display: inline-block;
    font-size: .75em;
    color: #667;
    margin: 0 .3em;
}

/* Listen / Spielplan */
ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.match-list li {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: .75em;
    align-items: center;
    padding: .65em;
    border-bottom: 1px solid #edf1f7;
}

.match-list li span:first-child {
    text-align: right;
}

.match-list li span:last-child {
    text-align: left;
}

.match-list strong {
    background: #edf3ff;
    color: var(--primary);
    border-radius: 8px;
    padding: .25em .6em;
    min-width: 70px;
    text-align: center;
}

.round-box {
    margin-bottom: 1.5em;
    padding: .8em;
    background: #f8fbff;
    border-radius: 10px;
}

/* Tabellen */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
    background: #fff;
}

th, td {
    padding: .65em;
    border-bottom: 1px solid #ddd;
    text-align: center;
    font-size: .95em;
}

th {
    background: #edf3ff;
    color: var(--primary);
}

td:first-child,
th:first-child {
    font-weight: 700;
}

.score-inputs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4em;
}

.score-inputs input {
    max-width: 75px;
    text-align: center;
}

/* Mobile */
@media (max-width: 700px) {
    body {
        font-size: 17px;
    }

    header {
        padding: .8em;
    }

    h1 {
        font-size: 1.45em;
    }

    main {
        padding: .75em;
    }

    section {
        padding: .85em;
        border-left-width: 4px;
    }

    .topnav {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .topnav a {
        padding: .65em .4em;
        font-size: .9em;
    }

    .highlight-grid {
        grid-template-columns: 1fr;
    }

    .big-match {
        font-size: 1.15em;
    }

    .match-list li {
        grid-template-columns: 1fr;
        text-align: center;
        gap: .3em;
    }

    .match-list li span:first-child,
    .match-list li span:last-child {
        text-align: center;
    }

    .match-list strong {
        justify-self: center;
    }

    .reload-box {
        text-align: left;
        background: #fff;
        border-radius: 8px;
        padding: .7em;
        box-shadow: 0 1px 3px rgba(0,0,0,.08);
    }

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
        width: 100%;
    }

    thead {
        display: none;
    }

    tr {
        margin-bottom: 1em;
        background: #ffffff;
        border-radius: 10px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.1);
        padding: .5em;
        border: 1px solid #edf1f7;
    }

    td {
        display: flex;
        justify-content: space-between;
        gap: 1em;
        text-align: right;
        border-bottom: 1px solid #eef2f8;
        padding: .65em .4em;
        font-size: 1em;
    }

    td:last-child {
        border-bottom: none;
    }

    td::before {
        content: attr(data-label);
        font-weight: 800;
        color: var(--primary);
        text-align: left;
    }

    .ranking-row td[data-label="Team"] {
        font-size: 1.12em;
        font-weight: 800;
        background: #f4f7fb;
        border-radius: 8px;
        margin-bottom: .25em;
    }

    .result-row td,
    .team-row td {
        align-items: center;
    }

    .score-inputs {
        justify-content: flex-end;
    }

    .score-inputs input {
        max-width: 64px;
        padding: .55em;
    }

    input[type="text"],
    input[type="number"],
    select,
    button {
        font-size: 1.05em;
        padding: .85em;
    }

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


/* Benutzerverwaltung / Login */
.login-box {
    max-width: 460px;
    margin: 2em auto;
}

.small-note {
    font-size: .9em;
    color: #5d6675;
}

.user-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1em;
}

.user-card {
    background: #f8fbff;
    border: 1px solid #dde7f7;
    border-radius: 10px;
    padding: 1em;
}

.user-card form + form {
    margin-top: .8em;
}

.checkline {
    display: flex;
    gap: .6em;
    align-items: center;
    font-weight: 700;
}

.checkline input {
    width: auto;
}

input[type="password"] {
    width: 100%;
    padding: .75em;
    font-size: 1em;
    border: 1px solid #ccd5e3;
    border-radius: 8px;
}

.danger-button {
    background: #b3261e;
}

@media (max-width: 700px) {
    .user-list {
        grid-template-columns: 1fr;
    }

    .login-box {
        margin: 0;
    }

    input[type="password"] {
        font-size: 1.05em;
        padding: .85em;
    }
}


/* Flexible Teameingabe */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .75em;
    margin: 1em 0;
}

.info-grid > div {
    background: #edf3ff;
    border: 1px solid #d9e5f8;
    border-radius: 10px;
    padding: .8em;
    color: var(--primary);
}

.notice-box {
    background: #eef4ff;
    border-left: 5px solid var(--primary);
    padding: .8em;
    border-radius: 8px;
}

.team-input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .8em;
}

.team-input-card {
    background: #f8fbff;
    border: 1px solid #dde7f7;
    border-radius: 10px;
    padding: .8em;
}

@media (max-width: 700px) {
    .info-grid,
    .team-input-grid {
        grid-template-columns: 1fr;
    }
}


/* Freilos-Anzeige */
.bye-box {
    background: #fff3cd;
    border-left: 5px solid #d39e00;
    color: #4b3a00;
    padding: .7em .9em;
    border-radius: 8px;
    margin: .6em 0 1em 0;
}


/* Teamverwaltung mit Spielern */
.team-management-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1em;
}

.team-management-card {
    background: #f8fbff;
    border: 1px solid #dde7f7;
    border-radius: 10px;
    padding: 1em;
}

.players-box {
    margin-top: 1em;
    padding-top: 1em;
    border-top: 1px solid #dde7f7;
}

.players-line {
    color: #566275;
    font-size: .95em;
    margin-top: -.5em;
}

@media (max-width: 700px) {
    .team-management-list {
        grid-template-columns: 1fr;
    }

    .ranking-table td[data-label="Spieler"] {
        font-size: .95em;
        color: #566275;
    }
}


/* Team-Spieler Popup */
.team-popup-link {
    width: auto;
    display: inline;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--primary);
    font: inherit;
    font-weight: 800;
    text-decoration: underline;
    cursor: pointer;
}

.team-popup-link:hover {
    filter: none;
    color: #1e376c;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 20, 35, .55);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1em;
}

.modal-overlay[hidden] {
    display: none;
}

.modal-box {
    position: relative;
    background: #ffffff;
    border-radius: 14px;
    width: min(420px, 100%);
    padding: 1.2em;
    box-shadow: 0 15px 40px rgba(0,0,0,.25);
    border-top: 6px solid #2f4f8f;
}

.modal-box h2 {
    margin-right: 2em;
}

.modal-close {
    position: absolute;
    top: .5em;
    right: .5em;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 999px;
    background: #edf3ff;
    color: var(--primary);
    font-size: 1.6em;
    line-height: 1;
}

.modal-players ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-players li {
    padding: .7em;
    border-bottom: 1px solid #edf1f7;
    font-weight: 700;
}

.modal-players li:last-child {
    border-bottom: none;
}

@media (max-width: 700px) {
    .team-popup-link {
        font-size: 1em;
    }

    .modal-box {
        margin: auto;
    }
}


/* Schnelle Ergebniseingabe */
.single-result-card {
    background: #f8fbff;
    border: 1px solid #dde7f7;
    border-radius: 14px;
    padding: 1em;
}

.round-label {
    font-weight: 800;
    color: var(--primary);
    margin-top: 0;
}

.single-match {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: .8em;
    align-items: center;
    margin: 1em 0;
}

.single-team {
    background: #ffffff;
    border: 1px solid #dde7f7;
    border-radius: 10px;
    padding: 1em;
    font-weight: 900;
    text-align: center;
    color: var(--primary);
}

.versus {
    font-weight: 700;
    color: #667;
}

.big-score-inputs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6em;
    margin-bottom: 1em;
}

.big-score-inputs input {
    max-width: 110px;
    text-align: center;
    font-size: 1.6em;
    font-weight: 900;
}

.big-score-inputs span {
    font-size: 2em;
    font-weight: 900;
    color: var(--primary);
}

.next-match-box {
    margin-top: 1em;
    background: #edf3ff;
    border-radius: 10px;
    padding: 1em;
}

.compact-list li {
    font-size: .95em;
}

@media (max-width: 700px) {
    .single-match {
        grid-template-columns: 1fr;
    }

    .versus {
        text-align: center;
    }

    .big-score-inputs input {
        max-width: 90px;
        font-size: 1.5em;
    }
}


/* Mobile Ergebniseingabe */
.filter-form {
    background: #f8fbff;
    border: 1px solid #dde7f7;
    border-radius: 12px;
    padding: 1em;
}

.secondary-link {
    background: #edf3ff;
    color: var(--primary);
}

.mobile-result-list {
    display: grid;
    gap: 1em;
}

.mobile-round-head {
    margin-top: .5em;
}

.mobile-result-card {
    border-radius: 14px;
    padding: 1em;
    border: 1px solid #dde7f7;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.mobile-result-card.is-open {
    border-left: 6px solid #d39e00;
}

.mobile-result-card.is-played {
    border-left: 6px solid #2e8b57;
}

.mobile-match-meta {
    font-size: .95em;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: .8em;
}

.mobile-teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: .6em;
    align-items: center;
    margin-bottom: 1em;
}

.mobile-teams div {
    background: #f4f7fb;
    border-radius: 10px;
    padding: .8em;
    text-align: center;
    font-weight: 900;
}

.mobile-teams span {
    color: #667;
    font-weight: 700;
}

.mobile-score-form {
    gap: .7em;
}

@media (max-width: 700px) {
    .mobile-teams {
        grid-template-columns: 1fr;
    }

    .mobile-teams span {
        text-align: center;
    }

    .filter-form {
        padding: .8em;
    }

    .mobile-result-card {
        padding: .85em;
    }
}


/* Korrektur: sichtbare Speicherbuttons pro Spiel */
.save-single-match,
.primary-action {
    display: block;
    width: 100%;
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 1em;
    font-size: 1.05em;
    font-weight: 900;
    text-align: center;
    cursor: pointer;
}

.save-single-match {
    margin-top: .8em;
}

.mobile-score-form label {
    font-weight: 900;
    color: var(--primary);
}

.mobile-result-card form {
    display: flex;
    flex-direction: column;
}

.mobile-match-meta span {
    display: inline-block;
    margin-left: .25em;
}

@media (max-width: 700px) {
    .save-single-match,
    .primary-action {
        font-size: 1.1em;
        padding: 1.05em;
    }
}


/* Mobile Frontend-Rangliste wieder als echte Tabelle */
.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ranking-scroll {
    border: 1px solid #dde7f7;
    border-radius: 10px;
    background: #ffffff;
}

@media (max-width: 700px) {
    .ranking-table,
    .ranking-table thead,
    .ranking-table tbody,
    .ranking-table th,
    .ranking-table td,
    .ranking-table tr {
        display: revert;
        width: auto;
    }

    .ranking-table {
        min-width: 720px;
        width: 100%;
        border-collapse: collapse;
        margin-top: 0;
    }

    .ranking-table thead {
        display: table-header-group;
    }

    .ranking-table tbody {
        display: table-row-group;
    }

    .ranking-table tr {
        display: table-row;
        margin-bottom: 0;
        padding: 0;
        box-shadow: none;
        border: none;
        border-radius: 0;
    }

    .ranking-table th,
    .ranking-table td {
        display: table-cell;
        text-align: center;
        padding: .55em .45em;
        border-bottom: 1px solid #dde7f7;
        font-size: .9em;
        white-space: nowrap;
    }

    .ranking-table td::before {
        content: none !important;
    }

    .ranking-table th:nth-child(2),
    .ranking-table td:nth-child(2) {
        text-align: left;
        min-width: 140px;
        position: sticky;
        left: 0;
        background: #ffffff;
        z-index: 1;
    }

    .ranking-table th:nth-child(2) {
        background: #edf3ff;
        z-index: 2;
    }

    .ranking-table td[data-label="Spieler"],
    .ranking-table th:nth-child(3) {
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .ranking-row td[data-label="Team"] {
        font-size: .9em;
        background: #ffffff;
        margin-bottom: 0;
        border-radius: 0;
    }
}


/* Ergebnis bearbeiten Popup */
.edit-result-button {
    display: block;
    width: 100%;
    margin-top: .6em;
    background: #edf3ff;
    color: var(--primary);
    border: 1px solid #c8d8f0;
    border-radius: 10px;
    padding: .85em;
    font-weight: 900;
    cursor: pointer;
}

.small-edit-button {
    font-size: .9em;
    padding: .55em .7em;
    margin-top: .5em;
}

.result-modal-box {
    max-width: 460px;
}

.edit-teams-line {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: .5em;
    align-items: center;
    margin: 1em 0;
}

.edit-teams-line strong {
    background: #f4f7fb;
    border-radius: 10px;
    padding: .75em;
    text-align: center;
    color: var(--primary);
}

.edit-teams-line span {
    color: #667;
    font-weight: 800;
}

@media (max-width: 700px) {
    .edit-teams-line {
        grid-template-columns: 1fr;
    }

    .edit-teams-line span {
        text-align: center;
    }

    .edit-result-button {
        font-size: 1.05em;
        padding: 1em;
    }
}


/* Design-Einstellungen */
.design-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1em;
}

.design-color-card {
    background: #f8fbff;
    border: 1px solid #dde7f7;
    border-radius: 12px;
    padding: 1em;
}

.design-color-card input[type="color"] {
    width: 100%;
    height: 54px;
    padding: .2em;
    border-radius: 10px;
}

.design-preview {
    background: var(--preview-bg);
    color: var(--preview-text);
    border: 1px solid #dde7f7;
    border-radius: 14px;
    overflow: hidden;
}

.preview-header {
    background: var(--preview-primary);
    color: #fff;
    padding: 1em;
    font-weight: 900;
    text-align: center;
}

.preview-body {
    padding: 1em;
}

.preview-card {
    background: var(--preview-card);
    border-left: 5px solid var(--preview-primary);
    border-radius: 10px;
    padding: 1em;
    box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

.preview-card button {
    background: var(--preview-primary);
    color: #fff;
}


/* Turnier aus Teamliste erstellen */
.builder-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1em;
}

.team-builder-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1em;
}

.team-builder-card {
    background: #f8fbff;
    border: 1px solid #dde7f7;
    border-radius: 12px;
    padding: 1em;
}

.builder-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8em;
    margin-bottom: .8em;
}

.remove-team-row {
    width: auto;
    background: #edf3ff;
    color: var(--primary);
    border: 1px solid #c8d8f0;
    padding: .45em .7em;
    font-size: .9em;
}

.builder-player-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .8em;
}

textarea {
    width: 100%;
    padding: .75em;
    font-size: 1em;
    border: 1px solid #ccd5e3;
    border-radius: 8px;
    font-family: inherit;
}

@media (max-width: 700px) {
    .team-builder-list,
    .builder-player-grid {
        grid-template-columns: 1fr;
    }

    .builder-card-head {
        align-items: stretch;
        flex-direction: column;
    }

    .remove-team-row {
        width: 100%;
    }
}


/* QR-Code Seite */
.qr-controls {
    display: grid;
    gap: .9em;
    max-width: 620px;
}

.qr-box {
    margin-top: 1.5em;
    background: #f8fbff;
    border: 1px solid #dde7f7;
    border-radius: 14px;
    padding: 1em;
    text-align: center;
}

.qr-box img {
    width: min(320px, 100%);
    height: auto;
    background: #fff;
    padding: .8em;
    border-radius: 12px;
    border: 1px solid #dde7f7;
}

.qr-url-output {
    word-break: break-all;
    background: #fff;
    border: 1px solid #dde7f7;
    border-radius: 8px;
    padding: .8em;
    text-align: left;
}

@media print {
    .qr-controls,
    .topnav {
        display: none !important;
    }

    .qr-box {
        border: none;
        box-shadow: none;
    }
}


/* Turnier-Optionen */
.option-box {
    background: #f8fbff;
    border: 1px solid #dde7f7;
    border-radius: 12px;
    padding: 1em;
    margin-bottom: 1em;
}


/* Team-Popup Statistik */
.modal-stats {
    margin-top: 1em;
    border-top: 1px solid #dde7f7;
    padding-top: 1em;
}

.modal-stats h3 {
    margin-top: 0;
    color: var(--primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .6em;
}

.stats-grid div {
    background: #f8fbff;
    border: 1px solid #dde7f7;
    border-radius: 10px;
    padding: .7em;
    display: flex;
    justify-content: space-between;
    gap: .8em;
}

.stats-grid strong {
    color: #566275;
}

.stats-grid span {
    font-weight: 900;
    color: var(--primary);
}

@media (max-width: 700px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}


/* Sponsorenverwaltung */
.sponsor-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1em;
    margin-bottom: 1em;
}

.sponsor-admin-card {
    background: #f8fbff;
    border: 1px solid #dde7f7;
    border-radius: 12px;
    padding: 1em;
}

.sponsor-preview {
    background: #fff;
    border: 1px solid #dde7f7;
    border-radius: 10px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .7em;
    margin-bottom: .8em;
}

.sponsor-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.sponsor-delete-list {
    display: grid;
    gap: .6em;
    margin-top: 1em;
}


/* Turnierlogo */
.site-logo {
    text-align: center;
    margin-bottom: .8em;
}

.site-logo img {
    max-height: 90px;
    max-width: min(320px, 100%);
    object-fit: contain;
    background: rgba(255,255,255,.9);
    border-radius: 12px;
    padding: .4em;
}

.logo-preview-box {
    background: #fff;
    border: 1px solid #dde7f7;
    border-radius: 12px;
    padding: 1em;
    text-align: center;
    margin-bottom: 1em;
}

.logo-preview-box img {
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
}


/* Teamlogos */
.team-logo-inline {
    width: 28px;
    height: 28px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: .35em;
    background: rgba(255,255,255,.92);
    border-radius: 6px;
    padding: 2px;
}

.team-popup-link {
    display: inline-flex;
    align-items: center;
    gap: .25em;
    max-width: 100%;
}

.team-modal-logo {
    text-align: center;
    margin-bottom: .7em;
}

.team-modal-logo img {
    max-width: 180px;
    max-height: 120px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #dde7f7;
    border-radius: 12px;
    padding: .5em;
}

.team-logo-admin-preview {
    background: #fff;
    border: 1px solid #dde7f7;
    border-radius: 10px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .7em;
    margin-bottom: .8em;
}

.team-logo-admin-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

@media (max-width: 700px) {
    .team-logo-inline {
        width: 24px;
        height: 24px;
    }
}


/* Vorhandene Teamlogos / Logo-Pool */
.logo-pool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1em;
}

.logo-pool-card {
    background: #f8fbff;
    border: 1px solid #dde7f7;
    border-radius: 12px;
    padding: .8em;
    text-align: center;
}

.logo-pool-card img {
    max-width: 100%;
    max-height: 110px;
    object-fit: contain;
    background: #fff;
    border-radius: 10px;
    padding: .4em;
    border: 1px solid #dde7f7;
}

.logo-pool-card p {
    font-size: .85em;
    word-break: break-all;
}


/* Regeln */
.rules-box {
    white-space: pre-line;
    line-height: 1.65;
    font-size: 1.02em;
}

textarea {
    width: 100%;
    padding: .8em;
    font-size: 1em;
    line-height: 1.5;
    border: 1px solid #ccd5e3;
    border-radius: 8px;
    font-family: inherit;
}


/* Regel-Kategorien */
.rules-actions {
    margin-bottom: 1em;
}

.rules-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .6em;
    margin-bottom: 1.2em;
}

.rules-tabs a {
    background: #edf3ff;
    color: var(--primary);
    border: 1px solid #c8d8f0;
    border-radius: 999px;
    padding: .55em .9em;
    font-weight: 800;
    text-decoration: none;
}

.rules-section {
    margin-bottom: 1.5em;
    padding: 1em;
    background: #f8fbff;
    border-radius: 12px;
    border: 1px solid #dde7f7;
}

.rules-edit-card {
    background: #f8fbff;
    border: 1px solid #dde7f7;
    border-radius: 12px;
    padding: 1em;
    margin-bottom: 1em;
}
