:root {
    --bg: #06071f;
    --surface: #12143c;
    --surface-2: #1b1e4d;
    --border: #2b2e63;
    --text: #eef0fb;
    --text-muted: #9498c9;
    --menu-text: #eef0fb;
    --table-text: #eef0fb;

    --accent: #e8393c;
    --accent-hover: #ff4d50;
    --danger: #a3181a;
    --danger-hover: #c21d20;
    --success: #4caf6d;
    --success-hover: #5cc47f;
    --warning: #e0a63e;
    --warning-hover: #eeb856;

    /* Linkfarbe (Nutzer-Wunsch: "Ihre Farbe soll immer das gold sein") --
       dasselbe Gold, das die Namens-Links im Turniermodul schon hatten
       (.swos-user-link weiter unten). Bewusst eigene Variablen und nicht
       --accent: die Communities dürfen ihre Farben über den <style>-Block
       in includes/header.php überschreiben, --accent bleibt dabei aber
       das Rot der Bedienelemente. Die Linkfarbe soll ausdrücklich überall
       gleich sein. */
    --link: #ffe9a8;
    --link-hover: #fff3cf;
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--bg);
    background-image:
        radial-gradient(1px 1px at 20% 15%, rgba(255,255,255,0.25) 0, transparent 100%),
        radial-gradient(1px 1px at 60% 40%, rgba(255,255,255,0.18) 0, transparent 100%),
        radial-gradient(1px 1px at 85% 10%, rgba(255,255,255,0.22) 0, transparent 100%),
        radial-gradient(1px 1px at 35% 75%, rgba(255,255,255,0.15) 0, transparent 100%),
        radial-gradient(1px 1px at 75% 65%, rgba(255,255,255,0.18) 0, transparent 100%);
    background-attachment: fixed;
    color: var(--text);
}

/* Überschriften in der Pixel-Schrift aus SWOS (Nutzer-Wunsch: "Pixel
   Schriften bei den Headlines" / "die Schrift von SWOS"). Selbst gehostet,
   kein Google Fonts. Die Originaldatei enthält nur ASCII, Kyrillisch und
   einzelne Balkan-Zeichen; Ä Ö Ü ä ö ü ß (und ẞ) wurden als Pixel-Glyphen
   im Stil von Š/Ž nachgetragen. Polnische/türkische Sonderzeichen fehlen
   weiterhin und kommen aus der Ersatzschrift (Arial). font-weight normal,
   weil eine künstlich gefettete Pixel-Schrift verschwimmt. ?v= bei
   Änderungen an der Datei hochzählen, sonst bleibt die alte im Cache. */
@font-face {
    font-family: "SWOS";
    src: url("/assets/fonts/SWOS.ttf?v=2") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: "SWOS", Arial, sans-serif;
    font-weight: normal;
}

/* Links sind im ganzen Projekt gold und werden NUR beim Darüberfahren
   unterstrichen (Nutzer-Wunsch).

   Die :not()-Liste nimmt alles aus, was zwar ein <a> ist, aber als
   Bedienelement auftritt: Schaltflächen, Menü-, Dropdown- und
   Listeneinträge bringen ihre eigene Farbe und Gestalt mit. Ohne diese
   Ausnahmen bekämen sie hier goldene Schrift und beim Darüberfahren einen
   Unterstrich, denn "a:hover" ist spezifischer (0,1,1) als Bootstraps
   ".btn" (0,1,0) und würde dessen "text-decoration: none" schlagen.
   .swos-menu-btn steht nicht in der Liste, weil es sich mit !important
   ohnehin selbst schützt. */
a:not(.btn):not(.nav-link):not(.dropdown-item):not(.navbar-brand):not(.list-group-item):not(.page-link):not(.badge) {
    color: var(--link);
    text-decoration: none;
}

a:not(.btn):not(.nav-link):not(.dropdown-item):not(.navbar-brand):not(.list-group-item):not(.page-link):not(.badge):hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Nutzer-Wunsch: die goldene Namens-Link-Farbe aus der Turnier-Detailansicht
   (ursprünglich nur lokal dort über .swos-retro-table a) soll ueberall im
   Turniermodul gelten -- gesetzt von swosUserLink() (helpers/swos.php), dem
   einzigen Ort, der jeden Namens-Link im Modul rendert. */
.swos-user-link {
    color: var(--link);
}

.swos-user-link:hover {
    color: var(--link-hover);
}

/* Logo im Header: höchstens 72 px hoch, auf schmalen Bildschirmen so breit
   wie Platz ist (das SWOS-UNITED-Logo ist 2171 px breit und wurde auf dem
   Handy abgeschnitten). max-height/max-width erhalten das Seitenverhältnis. */
.site-logo {
    display: block;
    max-height: 72px;
    max-width: 100%;
    width: auto;
    height: auto;
}

.navbar-brand {
    max-width: 100%;
}

/* Membercard und Sprachwahl stehen nebeneinander und sind gleich hoch.
   Auf dem Handy füllen sie zusammen die Zeile unter dem Logo. */
.header-language .btn {
    gap: 0.35rem;
}

/* Membercard im Farbton der eigenen Rolle in der aktuellen Community
   (api_roles.color, helpers/permissions.php getCommunityRoleBadge()).
   Nur background-image, damit die Grundfarbe eines Themes erhalten
   bleibt; die zusätzliche Klasse schlägt auch die Hover-Regeln der
   Themes. */
.header-membercard > .btn.has-role-color,
.header-membercard > .btn.has-role-color:hover,
.header-membercard > .btn.has-role-color.show {
    background-image: linear-gradient(100deg,
        color-mix(in srgb, var(--role-color) 65%, transparent) 0%,
        color-mix(in srgb, var(--role-color) 20%, transparent) 70%,
        transparent 100%);
    box-shadow: inset 5px 0 0 var(--role-color);
    padding-left: 0.9rem;
}

.header-membercard .header-role-name {
    font-weight: 600;
}

@media (max-width: 991.98px) {

    .header-account {
        width: 100%;
    }

    .header-membercard {
        flex: 1 1 auto;
        min-width: 0;
    }

    .header-membercard .btn > span:last-of-type {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Header-Menü als Grid bunter Retro-Buttons statt klassischer Navbar-Links
   (Nutzer-Wunsch, Referenz-Screenshot der alten SWOS-Joomla-Seite: "Das
   Headermenü kann auch recht lang werden und sollte auch zwei Zeilen
   ermöglichen") -- flex-wrap erlaubt beliebig viele Zeilen von selbst, kein
   Hamburger-Einklappen mehr nötig. Jeder Menüpunkt (auch Dropdown-Ober-
   punkte) steckt in einem .swos-menu-item, das die Hintergrundfarbe trägt
   (der eigentliche Button/Link selbst bleibt transparent) -- so greift die
   Farbrotation per :nth-child auch bei Dropdown-Punkten korrekt (ein reiner
   Link UND ein Dropdown-Wrapper sind sonst unterschiedlich tief verschachtelt
   und würden sich bei der Zählung nicht gleich verhalten). */
.swos-menu-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0.75rem 0;
}

/* Mobile: nur ein Aufklapp-Button statt des vollen Buttongrids (Nutzer-
   Wunsch: "Die Header Menü Buttons sollen mobile aber nur ein Dropdown oder
   aufklappmenü sein") -- eingeklappt per Default, der Toggle-Button in
   includes/navbar.php schaltet die Klasse unten per kleinem Vanilla-JS um.
   Ab der Bootstrap-lg-Breite (992px) bleibt das gewohnte, breite Buttongrid
   unverändert (Regel oben gilt dann wieder ungehindert). */
@media (max-width: 991.98px) {

    .swos-menu-grid {
        display: none;
        flex-direction: column;
    }

    .swos-menu-grid.swos-menu-grid-open {
        display: flex;
    }

    .swos-menu-item {
        width: 100%;
    }

    .swos-menu-btn {
        width: 100%;
    }

    /* Untermenüs klappen innerhalb der Liste auf, statt sich über die
       folgenden Knöpfe zu legen (gruppiertes Menü, 16.11.2026). */
    .swos-menu-grid .dropdown-menu {
        position: static !important;
        inset: auto !important;
        transform: none !important;
        width: 100%;
        max-height: none;
        margin: 0;
        border-width: 1px 0 0;
    }
}

.swos-menu-item {
    border-radius: 0;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 2px rgba(0, 0, 0, 0.4);
}

.swos-menu-item:nth-child(6n+1) { background: linear-gradient(180deg, #3f8f3f, #245c24); }
.swos-menu-item:nth-child(6n+2) { background: linear-gradient(180deg, #8a6d1f, #5c4913); }
.swos-menu-item:nth-child(6n+3) { background: linear-gradient(180deg, #5b3d8a, #3a2759); }
.swos-menu-item:nth-child(6n+4) { background: linear-gradient(180deg, #7a2e2e, #4e1c1c); }
.swos-menu-item:nth-child(6n+5) { background: linear-gradient(180deg, #2c4f7a, #1c3350); }
.swos-menu-item:nth-child(6n+0) { background: linear-gradient(180deg, #4a5568, #2d3340); }

.swos-menu-btn {
    display: block;
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    /* SWOS-Pixelschrift wie bei den Überschriften (Nutzer-Wunsch: "Auch
       die Menü Buttons sollen diese Schrift haben", @font-face oben).
       Nicht fett, sonst verschwimmen die Pixel. Ein Schrift-Pixel ist
       0,114em groß -- bei 17.5px also genau 2 Bildschirmpixel und damit
       scharf; 0.8rem (vorher, für Arial) ergab winzige, unscharfe Zeichen. */
    font-family: "SWOS", Arial, sans-serif;
    font-weight: normal;
    text-transform: uppercase;
    font-size: 17.5px;
    line-height: 1.2;
    color: #fff !important;
    text-decoration: none !important;
    cursor: pointer;
}

.swos-menu-btn:hover {
    filter: brightness(1.2);
}

.swos-menu-item .dropdown-menu {
    background: #131a44;
    border: 1px solid #4a5aa0;
    padding: 6px;
    min-width: 200px;
}

.swos-menu-item .dropdown-item {
    color: #ffd23f;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    border-radius: 0;
    padding: 0.45rem 0.6rem;
}

.swos-menu-item .dropdown-item:hover {
    background: #3f8f3f;
    color: #fff;
}

/* Gruppierte Menüs (helpers/navMenuGroups.php): Zwischenüberschrift je
   Spiel bzw. Admin-Abschnitt, Unterpunkte eingerückt, lange Listen scrollen
   statt über den Bildschirm hinauszuragen. */
.swos-menu-item .swos-menu-grouped {
    max-height: min(75vh, 640px);
    overflow-y: auto;
}

.swos-menu-item .dropdown-header {
    color: #8fa3ff;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.55rem 0.6rem 0.2rem;
    border-top: 1px solid #2c3a7a;
    margin-top: 0.2rem;
}

.swos-menu-item .swos-menu-grouped li:first-child .dropdown-header {
    border-top: 0;
    margin-top: 0;
}

.swos-menu-item .dropdown-item.swos-menu-sub {
    padding-left: 1.2rem;
}

/* Tabs (Profil-/Turnieransicht) als Retro-Buttons statt schlichter Bootstrap-
   Tabs (Nutzer-Wunsch, Referenz-Screenshot) -- ursprünglich nur lokal in
   views/tournament-detail.php definiert, jetzt global nutzbar (siehe
   views/public-profile.php). */
.swos-retro-tabbar.nav-tabs {
    border-bottom: none;
    gap: 6px;
}

.swos-retro-tabbar.nav-tabs .nav-link {
    background: linear-gradient(180deg, #303c74, #1c2450);
    border: 1px solid #4a5aa0;
    color: #ffd23f;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    border-radius: 0;
    margin-right: 0;
    padding: 0.5rem 1rem;
}

.swos-retro-tabbar.nav-tabs .nav-link:hover {
    color: #fff;
    border-color: #7ed17e;
}

.swos-retro-tabbar.nav-tabs .nav-link.active {
    background: linear-gradient(180deg, #3f8f3f, #245c24);
    border-color: #7ed17e;
    color: #fff;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-dark {
    color: var(--text) !important;
}

hr {
    border-color: var(--border);
    opacity: 1;
}

/* Navbar */

.navbar.bg-dark,
.bg-dark {
    background-color: var(--surface-2) !important;
}

.navbar {
    --bs-navbar-color: var(--menu-text);
    --bs-navbar-hover-color: var(--menu-text);
    --bs-navbar-active-color: var(--menu-text);
    --bs-navbar-brand-color: var(--menu-text);
    --bs-navbar-brand-hover-color: var(--menu-text);
}

/* Modul-Sidebar (Turniere, Team, ...): ab lg feste Spalte neben dem
   Inhalt, darunter klappt Bootstraps offcanvas-lg sie automatisch zur
   mobilen Schublade zusammen. Gemeinsame Klasse für alle Module, damit
   das Aussehen konsistent bleibt. */

.module-sidebar {
    background-color: var(--surface-2);
    color: var(--menu-text);
    border-color: var(--border);
}

.module-sidebar .nav-link {
    color: var(--menu-text);
}

.module-sidebar .nav-link.active {
    background-color: var(--accent);
    color: #fff;
}

.module-sidebar hr {
    border-color: var(--border);
}

@media (min-width: 992px) {

    .module-sidebar.offcanvas-lg {
        width: 240px;
        flex: 0 0 240px;
        border-radius: 0;
    }
}

/* Bg/card utilities used throughout the views */

.bg-white,
.bg-light,
.bg-body,
.bg-body-tertiary {
    background-color: var(--surface) !important;
}

.shadow-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
}

.border,
.border-top,
.border-bottom,
.border-start,
.border-end {
    border-color: var(--border) !important;
}

/* Cards */

.card {
    background-color: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.card-header,
.card-footer {
    background-color: rgba(255, 255, 255, 0.03);
    border-color: var(--border);
}

/* List groups (Turniere/Matches u. a. Modul-Listen): wie .card behandeln,
   sonst bleibt Bootstraps Standard-Weiß bestehen, da hierfür bislang keine
   eigene Regel existierte. */

.list-group-item {
    background-color: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.list-group-item.list-group-item-action:hover,
.list-group-item.list-group-item-action:focus {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

/* Buttons */

.btn,
.btn:hover,
.btn:active,
.btn:focus,
.btn:disabled,
.btn.disabled {
    border-radius: 0 !important;
    border-style: solid !important;
    border-width: 1px !important;
    border-top-color: #fff !important;
    border-left-color: #fff !important;
    border-right-color: #333333 !important;
    border-bottom-color: #333333 !important;
}

/* Eckige Ecken auch für inhaltstragende Boxen (Card/Alert/Modal/
   Dropdown/Badge/List-Group), aber ohne den 3D-Rand der Buttons — das
   war zu viel. Reine Layout-Divs (Bootstrap-Grid, Flex-Wrapper) bleiben
   bewusst ausgenommen. Labels und Spans bekommen weiterhin keinen Rand. */

.card,
.card-header,
.card-footer,
.alert,
.modal-content,
.dropdown-menu,
.list-group-item,
.badge,
.status,
.priority,
.type {
    border-radius: 0 !important;
}

.btn-primary {
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-bg: var(--accent-hover);
    --bs-btn-hover-border-color: var(--accent-hover);
    --bs-btn-active-bg: var(--accent-hover);
    --bs-btn-active-border-color: var(--accent-hover);
    --bs-btn-disabled-bg: var(--accent);
    --bs-btn-disabled-border-color: var(--accent);
}

.btn-outline-primary {
    --bs-btn-color: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-bg: var(--accent);
    --bs-btn-hover-border-color: var(--accent);
    --bs-btn-active-bg: var(--accent);
    --bs-btn-active-border-color: var(--accent);
}

.btn-danger {
    --bs-btn-bg: var(--danger);
    --bs-btn-border-color: var(--danger);
    --bs-btn-hover-bg: var(--danger-hover);
    --bs-btn-hover-border-color: var(--danger-hover);
    --bs-btn-active-bg: var(--danger-hover);
    --bs-btn-active-border-color: var(--danger-hover);
}

.btn-outline-danger {
    --bs-btn-color: var(--danger-hover);
    --bs-btn-border-color: var(--danger);
    --bs-btn-hover-bg: var(--danger);
    --bs-btn-hover-border-color: var(--danger);
    --bs-btn-active-bg: var(--danger);
    --bs-btn-active-border-color: var(--danger);
}

.btn-success {
    --bs-btn-bg: var(--success);
    --bs-btn-border-color: var(--success);
    --bs-btn-color: #06210f;
    --bs-btn-hover-bg: var(--success-hover);
    --bs-btn-hover-border-color: var(--success-hover);
    --bs-btn-hover-color: #06210f;
    --bs-btn-active-bg: var(--success-hover);
    --bs-btn-active-border-color: var(--success-hover);
    --bs-btn-active-color: #06210f;
}

.btn-outline-success {
    --bs-btn-color: var(--success);
    --bs-btn-border-color: var(--success);
    --bs-btn-hover-bg: var(--success);
    --bs-btn-hover-border-color: var(--success);
    --bs-btn-hover-color: #06210f;
}

.btn-warning {
    --bs-btn-bg: var(--warning);
    --bs-btn-border-color: var(--warning);
    --bs-btn-color: #2e2005;
    --bs-btn-hover-bg: var(--warning-hover);
    --bs-btn-hover-border-color: var(--warning-hover);
    --bs-btn-hover-color: #2e2005;
    --bs-btn-active-bg: var(--warning-hover);
    --bs-btn-active-border-color: var(--warning-hover);
    --bs-btn-active-color: #2e2005;
    --bs-btn-disabled-color: #2e2005;
}

.btn-outline-warning {
    --bs-btn-color: var(--warning);
    --bs-btn-border-color: var(--warning);
    --bs-btn-hover-bg: var(--warning);
    --bs-btn-hover-border-color: var(--warning);
    --bs-btn-hover-color: #2e2005;
}

.btn-secondary,
.btn-outline-secondary {
    --bs-btn-bg: var(--surface-2);
    --bs-btn-border-color: var(--border);
    --bs-btn-color: var(--text-muted);
    --bs-btn-hover-bg: var(--surface-2);
    --bs-btn-hover-border-color: var(--text-muted);
    --bs-btn-hover-color: var(--text);
    --bs-btn-active-bg: var(--surface-2);
    --bs-btn-active-border-color: var(--text-muted);
    --bs-btn-active-color: var(--text);
}

.btn-outline-light {
    --bs-btn-border-color: var(--border);
}

/* Dropdowns */

.dropdown-menu {
    background-color: var(--surface-2) !important;
    border-color: var(--border);
}

.dropdown-item {
    color: var(--menu-text) !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: rgba(255, 255, 255, 0.06) !important;
    color: var(--menu-text) !important;
}

.dropdown-divider {
    border-color: var(--border);
}

/* Forms */

input,
select,
.form-control,
.form-select,
input:focus,
select:focus,
.form-control:focus,
.form-select:focus,
input:disabled,
select:disabled,
.form-control:disabled,
.form-select:disabled {
    border-radius: 0 !important;
    border-style: solid !important;
    border-width: 1px !important;
    border-top-color: var(--form-border, #fff) !important;
    border-left-color: var(--form-border, #fff) !important;
    border-right-color: var(--form-border, #333333) !important;
    border-bottom-color: var(--form-border, #333333) !important;
    background-color: var(--form-bg, #333366) !important;
}

.form-control,
.form-select {
    background-color: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--surface);
    border-color: var(--accent);
    color: var(--text);
    box-shadow: 0 0 0 0.2rem rgba(232, 57, 60, 0.25);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:disabled,
.form-select:disabled {
    background-color: var(--surface-2);
    color: var(--text-muted);
}

.form-label,
.form-check-label {
    color: var(--form-label, var(--text));
}

.form-text {
    color: var(--form-text, var(--text-muted));
}

.input-group-text {
    background-color: var(--surface-2);
    border-color: var(--border);
    color: var(--text-muted);
}

/* Tables */

table {
    border-collapse: separate !important;
    border-spacing: 1px !important;
}

td,
th {
    border-radius: 0 !important;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--table-text);
    --bs-table-border-color: var(--border);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
    --bs-table-striped-color: var(--table-text);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.05);
    --bs-table-hover-color: var(--table-text);
    --bs-table-active-bg: rgba(255, 255, 255, 0.06);
    --bs-table-active-color: var(--table-text);
}

.table-clickable tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
}

.table th {
    white-space: nowrap;
    cursor: pointer;
    color: var(--text-muted);
}

.table td {
    vertical-align: middle;
}

.td-ranking-username {
    background-image: url("/assets/images/bg_ranking.gif");
    background-repeat: repeat-y;
    background-size: 100% auto;
}

.th-ranking-header {
    background-image: url("/assets/images/bg_ranking_header.gif");
    background-repeat: repeat-y;
    background-size: 100% auto;
}

.td-ranking-stat-odd {
    background-color: #666666 !important;
}

.td-ranking-stat-even {
    background-color: #777777 !important;
}

/* Modals */

.modal-content {
    background-color: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.modal-header,
.modal-footer {
    border-color: var(--border);
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Pagination */

.page-link {
    background-color: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.page-link:hover {
    background-color: var(--surface-2);
    border-color: var(--border);
    color: var(--text);
}

.page-item.active .page-link {
    background-color: var(--accent);
    border-color: var(--accent);
}

.page-item.disabled .page-link {
    background-color: var(--surface);
    border-color: var(--border);
    color: var(--text-muted);
}

/* Alerts */

.alert-danger {
    --bs-alert-bg: rgba(163, 24, 26, 0.18);
    --bs-alert-border-color: rgba(163, 24, 26, 0.4);
    --bs-alert-color: #ff8f8f;
}

.alert-success {
    --bs-alert-bg: rgba(76, 175, 109, 0.15);
    --bs-alert-border-color: rgba(76, 175, 109, 0.4);
    --bs-alert-color: var(--success);
}

.alert-warning {
    --bs-alert-bg: rgba(224, 166, 62, 0.15);
    --bs-alert-border-color: rgba(224, 166, 62, 0.4);
    --bs-alert-color: var(--warning);
}

.alert-info {
    --bs-alert-bg: rgba(148, 152, 201, 0.15);
    --bs-alert-border-color: var(--border);
    --bs-alert-color: var(--text-muted);
}

/* Badges */

.badge.bg-secondary {
    background-color: var(--surface-2) !important;
    color: var(--text-muted) !important;
}

.badge.bg-light {
    background-color: var(--surface-2) !important;
    color: var(--text) !important;
}

/* Status/priority/type pills */

.status,
.priority,
.type {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

/* Markierungsfarbe eines Tickets (MARKER_COLORS in helpers/colors.php).
   In der Listenansicht ein Punkt vor der ID, in der Boardansicht und auf der
   Detailseite die ID/der Farbname auf der Farbe -- immer weisse Schrift, wie
   bei den Pillen darueber. */

.issue-color-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.issue-color-key {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    color: #fff;
    font-weight: 600;
}

/* Eingebettete Bilder in Rich-Text-Inhalten (Ticket-Beschreibung/Kommentare,
   siehe views/issues/detail.php) -- Nutzer-Wunsch: "sollen nicht den Rahmen
   sprengen und selbst aber klickbar sein für eine größere Detailansicht des
   Bildes in einem layer" */
.rich-content img {
    max-width: 100%;
    height: auto;
    cursor: zoom-in;
}

.rich-content-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 2000;
    cursor: zoom-out;
}

.rich-content-lightbox img {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

.rich-content-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    background: none;
    border: none;
    cursor: pointer;
}

/* Cookie-Hinweis (Nutzer-Wunsch: "eine Cookie Abfrage ... für jede Webseite
   und Domain"), siehe includes/footer.php / assets/js/cookie-notice.js */
.cookie-notice {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2100;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.9rem 1.25rem;
    background: var(--surface, #fff);
    color: var(--text, #212529);
    border-top: 1px solid var(--border, #dee2e6);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.15);
}

.cookie-notice-text {
    max-width: 60rem;
    font-size: 0.9rem;
}

/* Platzhalter in den Rechtstexte-Vorlagen (views/legal/impressum.php,
   views/legal/datenschutz.php) -- deutlich sichtbar machen, was vor dem
   Live-Gang noch ausgefüllt werden muss. */
.legal-placeholder {
    background: rgba(255, 193, 7, 0.25);
    border: 1px dashed #ffc107;
    border-radius: 4px;
    padding: 0 0.35em;
    font-weight: 600;
}

/* Profil-Statistik (views/partials/profile-tab-stats.php): Ranglisten als
   Kacheln mit Logo, Siegquoten-Ring, Bilanzbalken, Kennzahlen,
   Anzeigetafeln. Farben: Siege --success, Unentschieden grau,
   Niederlagen --accent. */
.stats-ranking-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 8px;
}

.stats-ranking-tile {
    --ranking-color: #4a5aa0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 6px 8px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-bottom: 4px solid var(--ranking-color);
    border-radius: 0;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.stats-ranking-tile:hover {
    transform: translateY(-2px);
    border-color: var(--link);
    border-bottom-color: var(--ranking-color);
}

.stats-ranking-tile.active {
    border-color: var(--link);
    box-shadow: 0 0 0 2px var(--link) inset;
    border-bottom-color: var(--ranking-color);
}

.stats-ranking-tile-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-bottom: 2px;
}

.stats-ranking-tile-logo-all {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    line-height: 1;
    color: var(--link);
}

.stats-ranking-tile-platform {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    line-height: 1;
}

.stats-ranking-tile-label {
    font-family: "SWOS", Arial, sans-serif;
    font-size: 13px;
    line-height: 1.15;
    text-align: center;
    text-transform: uppercase;
}

.stats-ranking-tile-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.stats-ring {
    --win: 0deg;
    --draw: 0deg;
    width: 132px;
    height: 132px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(
        var(--success) 0 var(--win),
        #8a8fb8 var(--win) var(--draw),
        var(--accent) var(--draw) 360deg
    );
}

.stats-ring-inner {
    width: 98px;
    height: 98px;
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.stats-ring-value {
    font-family: "SWOS", Arial, sans-serif;
    font-size: 26px;
    line-height: 1;
}

.stats-ring-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.stats-big-number {
    font-family: "SWOS", Arial, sans-serif;
    font-size: 30px;
    line-height: 1;
}

.stats-record-bar {
    display: flex;
    height: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}

.stats-record-bar-thin {
    height: 6px;
    margin-top: 4px;
}

.stats-record-win { background: var(--success); }
.stats-record-draw { background: #8a8fb8; }
.stats-record-loss { background: var(--accent); }

.stats-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    vertical-align: baseline;
}

.stats-dot-win { background: var(--success); }
.stats-dot-draw { background: #8a8fb8; }
.stats-dot-loss { background: var(--accent); }

.stats-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}

.stats-kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 12px 10px;
    text-align: center;
}

.stats-kpi-icon {
    font-size: 20px;
    line-height: 1;
    margin-bottom: 6px;
}

.stats-kpi-value {
    font-family: "SWOS", Arial, sans-serif;
    font-size: 22px;
    line-height: 1.1;
}

.stats-kpi-label,
.stats-kpi-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.stats-scoreboard {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #000;
    border: 2px solid #333;
    font-family: "SWOS", Arial, sans-serif;
    font-size: 30px;
    line-height: 1;
}

.stats-scoreboard-win { color: #6fe08a; }
.stats-scoreboard-loss { color: #ff6b6b; }

.stats-scoreboard-colon {
    opacity: 0.7;
}

.stats-opponents li + li {
    margin-top: 10px;
}

.stats-medal-counts {
    display: flex;
    gap: 10px;
}

.stats-medal {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-family: "SWOS", Arial, sans-serif;
    font-size: 20px;
}

.stats-medal span {
    font-size: 22px;
}

.stats-medal-gold { border-bottom: 3px solid #d4af37; }
.stats-medal-silver { border-bottom: 3px solid #c0c0c0; }
.stats-medal-bronze { border-bottom: 3px solid #cd7f32; }

.stats-medal-list {
    max-height: 320px;
    overflow-y: auto;
}

/* Handy: Ranglisten-Kacheln als waagerecht wischbare Leiste statt
   mehrerer Zeilen, die den Inhalt nach unten schieben. */
@media (max-width: 575.98px) {

    .stats-ranking-tiles {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x proximity;
        padding-bottom: 6px;
    }

    .stats-ranking-tile {
        flex: 0 0 104px;
        scroll-snap-align: start;
    }

    .stats-ring {
        margin: 0 auto;
    }
}

.stats-ring.stats-ring-empty {
    background: rgba(255, 255, 255, 0.12);
}

/* Elo-Diagramm im Profil (renderSwosEloChartSvg() in helpers/swos.php). */
.elo-chart {
    position: relative;
}

.elo-chart svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.elo-grid {
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.elo-grid-year {
    stroke-dasharray: 3 4;
}

.elo-axis {
    fill: var(--text-muted);
    font-size: 11px;
}

.elo-line {
    fill: none;
    stroke: var(--elo-color, #4a8fd8);
    stroke-width: 2;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    filter: brightness(1.6);
}

.elo-marker-peak,
.elo-marker-low,
.elo-marker-current {
    stroke: #fff;
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
}

.elo-marker-peak { fill: var(--success); }
.elo-marker-low { fill: var(--accent); }
.elo-marker-current { fill: var(--link); }

.elo-legend {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    vertical-align: baseline;
}

.elo-legend.elo-marker-peak { background: var(--success); }
.elo-legend.elo-marker-low { background: var(--accent); }
.elo-legend.elo-marker-current { background: var(--link); }

.elo-cursor-line {
    stroke: rgba(255, 255, 255, 0.5);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
    visibility: hidden;
}

.elo-cursor-dot {
    fill: var(--link);
    stroke: #fff;
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
    visibility: hidden;
}

.elo-chart.elo-hover .elo-cursor-line,
.elo-chart.elo-hover .elo-cursor-dot {
    visibility: visible;
}

.elo-chart-tooltip {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid var(--border);
    color: #fff;
    font-size: 0.8rem;
    white-space: nowrap;
    transform: translate(-50%, -120%);
    display: none;
}

.elo-chart.elo-hover .elo-chart-tooltip {
    display: block;
}

/* Unterstützer-Abzeichen im Profil und Seite /users/supporters
   (helpers/swosCommunityExtras.php), wie "Supporting Member" der alten Seite. */
.supporter-badge {
    display: inline-block;
    background: linear-gradient(45deg, #363, #373);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    font-weight: normal;
}

.supporter-badge:hover {
    color: #fff;
    filter: brightness(1.25);
}

.supporters-year + .supporters-year {
    margin-top: 14px;
}

.supporters-year-label {
    font-family: "SWOS", Arial, sans-serif;
    font-weight: normal;
    font-size: 18px;
}

.supporters-bar {
    height: 12px;
    margin-top: 4px;
    background: rgba(255, 255, 255, 0.08);
}

.supporters-bar > span {
    display: block;
    height: 100%;
    background: var(--warning);
}

.supporters-bar > span.supporters-bar-reached {
    background: var(--success);
}

/* Länderübersicht /users/countries */
.member-country-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
}

.member-country {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 4px 10px;
    padding: 8px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.member-country-flag {
    font-size: 1.4rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.member-country-count {
    font-family: "SWOS", Arial, sans-serif;
    font-size: 16px;
}

.member-country-bar {
    grid-column: 1 / -1;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
}

.member-country-bar > span {
    display: block;
    height: 100%;
    background: var(--link);
}

/* Event-Statistik (views/event-stats.php). */
.event-stats-bar {
    height: 4px;
    margin-top: 2px;
    background: rgba(255, 255, 255, 0.08);
}

.event-stats-bar > span {
    display: block;
    height: 100%;
    background: var(--link);
}

.event-stats-board li {
    padding: 3px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.event-stats-board li:last-child {
    border-bottom: 0;
}

.event-stats-rank {
    display: inline-block;
    min-width: 1.8em;
    color: var(--bs-secondary-color, #888);
}

table.event-stats-sortable th[data-dir="asc"]::after { content: " ▲"; font-size: 0.7em; }
table.event-stats-sortable th[data-dir="desc"]::after { content: " ▼"; font-size: 0.7em; }

table.event-stats-sortable tr.event-stats-group th {
    padding-top: 14px;
    background: rgba(255, 255, 255, 0.05);
}

table.event-stats-sortable tr.event-stats-sum td {
    font-weight: bold;
    border-top: 2px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.04);
}

/* Turnierkalender (views/tournament-calendar.php). */
.tournament-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}

.tournament-calendar-weekday {
    text-align: center;
    font-size: 12px;
    text-transform: uppercase;
    opacity: .7;
    padding: 4px 0;
}

.tournament-calendar-day {
    min-height: 96px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.tournament-calendar-blank {
    border-color: transparent;
    background: transparent;
}

.tournament-calendar-today {
    border-color: var(--link, #f0c000);
    box-shadow: inset 0 0 0 1px var(--link, #f0c000);
}

.tournament-calendar-date {
    font-weight: bold;
    font-size: 13px;
}

.tournament-calendar-date-weekday {
    display: none;
}

.tournament-calendar-entry {
    display: block;
    font-size: 11.5px;
    line-height: 1.25;
    padding: 2px 4px;
    border-left: 3px solid var(--ranking-color, #6c757d);
    background: rgba(255, 255, 255, 0.06);
    text-decoration: none;
    overflow-wrap: anywhere;
}

.tournament-calendar-more summary {
    font-size: 11.5px;
    cursor: pointer;
    opacity: .8;
}

.tournament-calendar-more[open] {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tournament-calendar-time {
    opacity: .7;
    margin-right: 2px;
}

@media (max-width: 767.98px) {
    .tournament-calendar {
        grid-template-columns: 1fr;
    }

    .tournament-calendar-weekday,
    .tournament-calendar-blank,
    .tournament-calendar-empty {
        display: none;
    }

    .tournament-calendar-day {
        min-height: 0;
    }

    .tournament-calendar-date-weekday {
        display: inline;
        margin-right: 4px;
        opacity: .7;
    }
}

/* Sternstufen und Skill-Bewertung (helpers/swosCommunityExtras.php). */
.ranking-level-stars {
    height: 12px;
    vertical-align: middle;
    image-rendering: pixelated;
}

.skill-rating-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 8px;
}

.skill-rating {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 8px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.05);
}

.skill-rating-value {
    font-weight: bold;
    font-variant-numeric: tabular-nums;
}

.skill-rating-stars {
    grid-column: 1 / -1;
}

/* Spiele-Werbung (helpers/gameAds.php). */
.game-ad-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
}

.game-ad {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-decoration: none;
}

.game-ad img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 4px;
}

.game-ad-title {
    font-weight: bold;
    font-size: 13px;
}

.game-ad-platform {
    font-size: 11px;
    opacity: .7;
}

.game-ad-sidebar .game-ad {
    max-width: 160px;
}

/* Achievements im Profil (views/partials/profile-tab-achievements.php). */
.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
}

.achievement {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 12px 10px 10px;
    text-align: center;
}

.achievement-locked {
    opacity: 0.45;
}

.achievement-count {
    font-family: "SWOS", Arial, sans-serif;
    font-size: 24px;
    line-height: 1.1;
}

.achievement-title {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.achievement-stars {
    min-height: 20px;
}

.achievement-stars img {
    width: 74px;
    height: 20px;
    image-rendering: pixelated;
}

.achievement-progress {
    height: 4px;
    margin-top: 6px;
    background: rgba(255, 255, 255, 0.08);
}

.achievement-progress > span {
    display: block;
    height: 100%;
    background: var(--link);
}

/* "Meine offenen Spiele" (views/online-my-matches.php). Jede Zeile hat
   dasselbe Raster: links der Gegner, rechts die Ergebniseingabe mit festen
   Spalten (Heimname, Tore, Doppelpunkt, Tore, Gastname, Knöpfe), damit
   Felder und Knöpfe untereinander stehen, egal wie lang die Namen sind. */

/* Kennzahlen = Filter: sechs gleich breite Kacheln in einer Reihe. */
.my-match-kpis {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.my-match-kpi {
    color: inherit;
    font: inherit;
    cursor: pointer;
    transition: border-color .15s, background-color .15s;
}

.my-match-kpi:hover:not(:disabled) {
    border-color: var(--link);
}

.my-match-kpi.active {
    border-color: var(--link);
    box-shadow: inset 0 -3px 0 var(--link);
}

.my-match-kpi:disabled {
    opacity: .45;
    cursor: default;
}

.my-match-group {
    border-left: 4px solid var(--ranking-color, #4a5aa0) !important;
    overflow: hidden;
    /* Zeilen richten sich nach der Breite der Gruppe, nicht des Fensters
       (Seitenleiste der Turnierseiten nimmt Platz weg). */
    container-type: inline-size;
}

.my-match-group-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid var(--border);
}

.my-match-group-title {
    font-weight: 600;
    font-size: 1rem;
}

.my-match-group-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    flex-shrink: 0;
}

.min-w-0 {
    min-width: 0;
}

.my-match {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 20px;
    align-items: center;
    padding: 10px 14px;
    border-top: 1px solid var(--border);
}

.my-match:first-child {
    border-top: 0;
}

.my-match-confirm,
.my-match-conflict {
    background: rgba(224, 166, 62, 0.08);
}

.my-match-opponent {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.my-match-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.my-match-avatar-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
}

/* Rechte Spalte: Statuszeile, Formular und Knöpfe untereinander,
   rechtsbündig. */
.my-match-action {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.my-match-status {
    display: flex;
    align-items: center;
    gap: 4px;
}

.my-match-buttons {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.my-match-buttons .btn {
    white-space: nowrap;
}

.my-match-form {
    display: grid;
    grid-template-columns: 120px 52px auto 52px 120px auto;
    align-items: center;
    gap: 6px;
}

.my-match-form > .collapse,
.my-match-form > .collapsing {
    grid-column: 1 / -1;
}

.my-match-goal {
    width: 52px;
    text-align: center;
}

.my-match-colon {
    font-weight: bold;
    text-align: center;
}

.my-match-name {
    font-size: 0.85rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.my-match-form > .my-match-name:first-of-type {
    text-align: right;
}

.my-match-name-own {
    color: var(--link);
    font-weight: 600;
}

.my-match-extra {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
    padding-top: 6px;
}

.my-match-stale > summary {
    cursor: pointer;
    color: var(--text-muted);
}

/* Schmale Gruppe: Gegner über der Eingabe. */
@container (max-width: 760px) {

    .my-match {
        grid-template-columns: 1fr;
    }

    .my-match-action {
        align-items: stretch;
    }

    .my-match-form {
        grid-template-columns: minmax(0, 1fr) 52px auto 52px minmax(0, 1fr) auto;
    }
}

/* Sehr schmal (Handy): ohne Namen neben den Feldern; die Felder zeigen
   "Du" bzw. den Gegner als Platzhalter. */
@container (max-width: 480px) {

    .my-match-name {
        display: none;
    }

    .my-match-form {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px;
    }

    .my-match-form > .my-match-buttons {
        margin-left: auto;
    }

    .my-match-form > .collapse,
    .my-match-form > .collapsing {
        flex-basis: 100%;
    }

    .my-match-extra {
        justify-content: flex-start;
    }
}

@media (max-width: 767.98px) {

    .my-match-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Handy: Kennzahlen-Kacheln (Profil, Elo, Meine offenen Spiele) drei je
   Zeile und flacher. */
@media (max-width: 575.98px) {

    .stats-kpis {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .stats-kpi {
        padding: 8px 4px;
    }

    .stats-kpi-icon {
        font-size: 15px;
        margin-bottom: 2px;
    }

    .stats-kpi-value {
        font-size: 17px;
    }

    .stats-kpi-label,
    .stats-kpi-sub {
        font-size: 0.7rem;
    }
}

/* 5-Jahres-Wertung (views/five-year-ranking.php): Verbandslogos in den
   Tabellen und Podest der Gesamtwertung. */
.association-cell {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.association-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

.association-logo-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
}

.association-podium {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: end;
    gap: 10px;
    max-width: 640px;
    margin: 0 auto;
}

.association-podium-place {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
}

.association-podium-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.association-podium-gold .association-podium-logo {
    width: 96px;
    height: 96px;
}

.association-podium-name {
    font-size: 0.85rem;
    line-height: 1.2;
    min-height: 2.4em;
}

.association-podium-value {
    font-family: "SWOS", Arial, sans-serif;
    font-size: 18px;
}

.association-podium-step {
    width: 100%;
    font-family: "SWOS", Arial, sans-serif;
    font-size: 26px;
    color: #000;
    padding: 6px 0;
}

.association-podium-gold .association-podium-step {
    background: linear-gradient(180deg, #f0d264, #c9a227);
    height: 86px;
}

.association-podium-silver .association-podium-step {
    background: linear-gradient(180deg, #e2e2e2, #a9a9a9);
    height: 62px;
}

.association-podium-bronze .association-podium-step {
    background: linear-gradient(180deg, #e2a46c, #a8642f);
    height: 46px;
}

@media (max-width: 575.98px) {

    .association-podium-logo {
        width: 52px;
        height: 52px;
    }

    .association-podium-gold .association-podium-logo {
        width: 68px;
        height: 68px;
    }

    .association-podium-name {
        font-size: 0.72rem;
    }
}

/* Europapokal-Startplätze in der 5-Jahres-Wertung (helpers/swosEuropeanSlots.php),
   Farben nach Rang der Wettbewerbe. */
.euro-badges {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.euro-badge {
    display: inline-block;
    padding: 1px 7px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    white-space: nowrap;
    cursor: default;
}

.euro-badge b {
    font-weight: 800;
}

.euro-badge-cl { background: linear-gradient(180deg, #1e3a8a, #0b1f5c); }
.euro-badge-cwc { background: linear-gradient(180deg, #9b1c1c, #6b1010); }
.euro-badge-issf { background: linear-gradient(180deg, #b7791f, #7a4f10); }
.euro-badge-cc { background: linear-gradient(180deg, #2f7a3a, #1c4f24); }

.euro-legend {
    padding: 10px 12px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.15);
}

/* Mitgliederkarte (views/members-map.php): Karte mit Länderliste daneben,
   dunkle Kacheln per Filter (gleicher OpenStreetMap-Dienst wie bisher). */
.members-map-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 12px;
}

.members-map {
    height: 640px;
    border: 1px solid var(--border);
    background: #0b0d1c;
}

.members-map .leaflet-tile-pane {
    filter: invert(1) hue-rotate(200deg) brightness(0.85) contrast(0.9) saturate(0.6);
}

.members-map-sidebar {
    display: flex;
    flex-direction: column;
    max-height: 640px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.members-map-sidebar-title {
    padding: 10px 12px;
    font-family: "SWOS", Arial, sans-serif;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
}

.members-map-countries {
    overflow-y: auto;
    padding: 6px;
}

.members-map-country {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 2px 8px;
    width: 100%;
    padding: 5px 6px;
    background: none;
    border: 0;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.members-map-country:hover {
    background: rgba(255, 255, 255, 0.06);
}

.members-map-country-name {
    font-size: 0.85rem;
}

.members-map-country-count {
    font-family: "SWOS", Arial, sans-serif;
    font-size: 14px;
}

.members-map-country-bar {
    grid-column: 1 / -1;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
}

.members-map-country-bar > span {
    display: block;
    height: 100%;
    background: var(--link);
}

.members-map-bubble-wrap,
.members-map-pin-wrap {
    background: none;
    border: 0;
}

.members-map-bubble {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 233, 168, 0.18);
    border: 2px solid var(--link);
    box-shadow: 0 0 10px rgba(255, 233, 168, 0.35);
    color: #fff;
    font-size: 11px;
    line-height: 1.1;
    transition: transform 0.15s ease;
}

.members-map-bubble:hover {
    transform: scale(1.12);
    background: rgba(255, 233, 168, 0.32);
}

.members-map-bubble .fi {
    font-size: 14px;
    margin-bottom: 1px;
}

.members-map-bubble-count {
    font-weight: 700;
    text-shadow: 0 1px 2px #000;
}

.members-map-pin {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fff;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.members-map-pin img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.members-map-pin-own {
    border-color: var(--link);
}

.members-map-popup-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
}

@media (max-width: 991.98px) {

    .members-map-layout {
        grid-template-columns: 1fr;
    }

    .members-map {
        height: 420px;
    }

    .members-map-sidebar {
        max-height: 260px;
    }
}

.members-map-cluster {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(76, 175, 109, 0.85);
    border: 2px solid #fff;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

/* Höchste Siege / Niederlagen (views/partials/swos-top-results.php). */
.top-result {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-result + .top-result {
    margin-top: 8px;
}

.top-result-rank {
    width: 18px;
    text-align: right;
    color: var(--text-muted);
    font-family: "SWOS", Arial, sans-serif;
}

.stats-scoreboard-sm {
    font-size: 18px;
    padding: 3px 9px;
    min-width: 64px;
    justify-content: center;
}

a.stats-scoreboard:hover {
    border-color: var(--link);
}

/* "Jetzt online" (views/partials/online-members.php, Profil). */
.online-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #3ddc84;
    box-shadow: 0 0 6px #3ddc84;
    vertical-align: middle;
    animation: online-pulse 2s ease-in-out infinite;
}

@keyframes online-pulse {
    50% { opacity: 0.45; }
}

.online-members-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 10px 6px;
}

.online-member {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--text);
    min-width: 0;
}

.online-member-avatar {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid #3ddc84;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.online-member-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.online-member-badge {
    position: absolute;
    right: -6px;
    bottom: -4px;
    font-size: 12px;
    line-height: 1;
}

.online-member-name {
    max-width: 100%;
    font-size: 0.72rem;
}

/* Event-Seite: Medaillenspiegel und Teilnehmer (views/partials/event-*.php). */
.is-collapsed {
    display: none;
}

.event-medal-group {
    border-left: 4px solid var(--ranking-color, #4a5aa0) !important;
}

.event-medal-top1 td:nth-child(2) { font-weight: 700; }
.event-medal-top1 td:first-child { color: #d4af37; font-weight: 700; }
.event-medal-top2 td:first-child { color: #c0c0c0; font-weight: 700; }
.event-medal-top3 td:first-child { color: #cd7f32; font-weight: 700; }

.event-participant-bar {
    display: inline-block;
    width: 120px;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
}

.event-participant-bar > span {
    display: block;
    height: 100%;
    background: var(--link);
}

@media (max-width: 575.98px) {

    .event-participant-bar {
        width: 50px;
    }
}

/* Wiki: Screenshots in Artikeln */
.wiki-article-content img {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 0.75rem 0 1.25rem;
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 6px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

/* Premium-Optik (helpers/premiumStyle.php): goldener Avatar-Rahmen, Stern,
   Profil-Banner, Auswahl auf /billing/premium. */
.premium-avatar {
    box-shadow: 0 0 0 3px #e0a800, 0 0 10px rgba(224, 168, 0, 0.55);
}

.premium-star {
    color: #e0a800;
    font-size: 0.85em;
}

.premium-profile-banner,
.premium-banner-preview {
    height: 110px;
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
}

.premium-banner-preview:not([style*="background"]) {
    height: 0;
}

.premium-swatch,
.premium-banner-option {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid rgba(127, 127, 127, 0.35);
}

.premium-banner-option {
    width: 72px;
    border-radius: 8px;
}

.premium-swatch-none {
    background: transparent;
}

.premium-swatch input,
.premium-banner-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.premium-swatch:has(input:checked),
.premium-banner-option:has(input:checked) {
    outline: 3px solid #e0a800;
    outline-offset: 2px;
}

.premium-swatch:has(input:focus-visible),
.premium-banner-option:has(input:focus-visible) {
    outline: 3px solid #3d8bfd;
    outline-offset: 2px;
}

.premium-badge {
    display: inline-block;
    background: linear-gradient(45deg, #b8860b, #e0a800);
    color: #fff;
    font-weight: normal;
}

.premium-badge:hover {
    color: #fff;
    filter: brightness(1.15);
}

/* Premium-Statistik: Spiele je Monat (Balkenhoehe), gruener Anteil = Siege. */
.premium-month-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 140px;
}

.premium-month {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    min-width: 0;
}

.premium-month-bar {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 2px;
    background: rgba(127, 127, 127, 0.35);
    border-radius: 3px 3px 0 0;
    overflow: hidden;
}

.premium-month-win {
    display: block;
    background: #2fb36f;
}

.premium-month-label {
    font-size: 0.7rem;
    text-align: center;
    opacity: 0.7;
    margin-top: 3px;
    white-space: nowrap;
}
