/**
 * SportData Center - Profilseiten (Vereine, Spieler & Spiele)
 *
 * Ersetzt die frueher in den Templates eingebetteten <style>-Bloecke.
 * Vereinsfarben kommen als Custom Properties --sdc-primary / --sdc-secondary
 * aus dem Template und faerben Hero, Akzente und aktive Zustaende.
 */

.sdc-p {
    --sdc-primary: #0f172a;
    --sdc-secondary: #38bdf8;
    --sdc-surface: #ffffff;
    --sdc-border: #e2e8f0;
    --sdc-muted: #64748b;
    --sdc-text: #0f172a;
    --sdc-soft: #f8fafc;
    --sdc-radius: 14px;

    max-width: 1180px;
    margin: 0 auto;
    padding: 20px 16px 56px;
    color: var(--sdc-text);
}

/* ---------------------------------------------------------------- Hero -- */

.sdc-p-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--sdc-radius);
    padding: 26px 26px 22px;
    margin-bottom: 18px;
    color: #fff;
    background: linear-gradient(135deg, var(--sdc-primary) 0%, var(--sdc-secondary) 165%);
}

/* Dezente Aufhellung, damit auch sehr dunkle Vereinsfarben Tiefe bekommen. */
.sdc-p-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 82% 12%, rgba(255, 255, 255, .18), transparent 58%);
    pointer-events: none;
}

.sdc-p-hero-inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
}

.sdc-p-crest {
    flex: 0 0 auto;
    width: 104px;
    height: 104px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .95);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-shadow: 0 6px 22px rgba(0, 0, 0, .18);
}

.sdc-p-crest img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.sdc-p-crest-empty { font-size: 42px; line-height: 1; }

.sdc-p-head { flex: 1 1 260px; min-width: 0; }

.sdc-p-eyebrow {
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
    opacity: .82;
    margin: 0 0 4px;
    font-weight: 700;
}

.sdc-p-title {
    margin: 0 0 10px;
    font-size: clamp(25px, 3.6vw, 40px);
    line-height: 1.08;
    color: #fff;
    overflow-wrap: anywhere;
}

.sdc-p-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 13.5px;
}

.sdc-p-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .2);
    padding: 5px 12px;
    border-radius: 999px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}

a.sdc-p-chip:hover { background: rgba(255, 255, 255, .28); color: #fff; }
.sdc-p-chip img { border-radius: 3px; background: #fff; }

/* Formkurve */
.sdc-p-form { display: inline-flex; gap: 5px; }

.sdc-p-form span {
    width: 25px;
    height: 25px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: #64748b;
}

.sdc-p-form .win { background: #16a34a; }
.sdc-p-form .draw { background: #a16207; }
.sdc-p-form .loss { background: #dc2626; }

/* -------------------------------------------------------- Navigation --- */

.sdc-p-nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    border-bottom: 2px solid var(--sdc-border);
    margin-bottom: 20px;
    scrollbar-width: thin;
}

.sdc-p-nav a {
    padding: 11px 17px;
    font-weight: 600;
    font-size: 14.5px;
    color: var(--sdc-muted);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
}

.sdc-p-nav a:hover { color: var(--sdc-text); }

.sdc-p-nav a[aria-current="page"] {
    color: var(--sdc-primary);
    border-bottom-color: var(--sdc-primary);
}

/* ------------------------------------------------------------ Layout --- */

.sdc-p-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(270px, 1fr);
    gap: 18px;
    align-items: start;
}

.sdc-p-grid.is-wide { grid-template-columns: 1fr; }

@media (max-width: 920px) {
    .sdc-p-grid { grid-template-columns: 1fr; }
}

.sdc-card {
    background: var(--sdc-surface);
    border: 1px solid var(--sdc-border);
    border-radius: var(--sdc-radius);
    padding: 18px 20px;
    margin-bottom: 18px;
}

.sdc-card > :last-child { margin-bottom: 0; }

.sdc-card-title {
    margin: 0 0 14px;
    font-size: 17px;
    line-height: 1.3;
    padding-bottom: 11px;
    border-bottom: 1px solid var(--sdc-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.sdc-card-title .sdc-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--sdc-muted);
}

.sdc-prose { line-height: 1.72; }
.sdc-prose > :first-child { margin-top: 0; }

/* ------------------------------------------------------------- Fakten -- */

.sdc-facts { list-style: none; margin: 0; padding: 0; }

.sdc-facts li {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 9px 0;
    border-bottom: 1px solid var(--sdc-soft);
    font-size: 14px;
}

.sdc-facts li:last-child { border-bottom: none; }
.sdc-facts dt, .sdc-facts .k { color: var(--sdc-muted); }
.sdc-facts dd, .sdc-facts .v { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }

/* -------------------------------------------------------------- Kader -- */

.sdc-squad-group + .sdc-squad-group { margin-top: 20px; }

.sdc-squad-head {
    font-size: 12px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--sdc-muted);
    font-weight: 700;
    margin: 0 0 9px;
}

.sdc-squad {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.sdc-squad a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border: 1px solid var(--sdc-border);
    border-radius: 11px;
    text-decoration: none;
    color: inherit;
    background: var(--sdc-surface);
    transition: border-color .15s, transform .15s;
}

.sdc-squad a:hover {
    border-color: var(--sdc-primary);
    transform: translateY(-1px);
}

.sdc-squad img {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    object-fit: cover;
    background: var(--sdc-soft);
    flex: 0 0 auto;
}

.sdc-squad-name {
    font-weight: 600;
    font-size: 13.5px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.sdc-squad-nr {
    font-size: 11.5px;
    color: var(--sdc-muted);
    font-weight: 700;
}

/* ------------------------------------------------------------- Spiele -- */

.sdc-p-fixtures { list-style: none; margin: 0; padding: 0; }

/* Das Raster liegt auf dem li - so stimmt die Zeile auch ohne Link. */
.sdc-p-fixtures li {
    display: grid;
    grid-template-columns: 74px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--sdc-soft);
}

/* Ist die Zeile verlinkt, spannt das <a> alle Spalten und bildet das
   Raster ein zweites Mal - damit funktionieren beide Faelle ohne :has(). */
.sdc-p-fixtures li > a.sdc-p-mlink {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 74px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 4px 10px;
    margin: -4px -10px;
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
}

.sdc-p-fixtures li > a.sdc-p-mlink:hover {
    background: var(--sdc-soft);
}

.sdc-p-fixtures li:last-child { border-bottom: none; }

.sdc-p-mdate {
    font-size: 12px;
    color: var(--sdc-muted);
    font-weight: 600;
    line-height: 1.35;
}

.sdc-p-mteams {
    font-size: 14px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.sdc-p-mteams .is-self { font-weight: 700; }

.sdc-p-mscore {
    font-weight: 800;
    font-size: 15px;
    padding: 4px 11px;
    border-radius: 8px;
    background: var(--sdc-soft);
    white-space: nowrap;
}

.sdc-p-mscore.win { background: #dcfce7; color: #15803d; }
.sdc-p-mscore.draw { background: #fef9c3; color: #854d0e; }
.sdc-p-mscore.loss { background: #fee2e2; color: #b91c1c; }
.sdc-p-mscore.pending { background: var(--sdc-soft); color: var(--sdc-muted); font-weight: 600; }

/* ------------------------------------------------------------ Tabelle -- */

.sdc-p-table-wrap { overflow-x: auto; }

.sdc-p-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 520px;
}

.sdc-p-table th {
    text-align: left;
    font-size: 11.5px;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--sdc-muted);
    padding: 9px 8px;
    border-bottom: 2px solid var(--sdc-border);
    white-space: nowrap;
}

.sdc-p-table td {
    padding: 9px 8px;
    border-bottom: 1px solid var(--sdc-soft);
}

.sdc-p-table tbody tr.is-self {
    background: color-mix(in srgb, var(--sdc-primary) 8%, transparent);
    font-weight: 700;
}

.sdc-p-table .num { text-align: center; width: 42px; }
.sdc-p-table .pts { text-align: center; font-weight: 800; }
.sdc-p-table-club { display: flex; align-items: center; gap: 8px; }
.sdc-p-table-club img { width: 20px; height: 20px; object-fit: contain; }
.sdc-p-table a { color: inherit; text-decoration: none; }
.sdc-p-table a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- FAQ -- */

.sdc-faq-item {
    border: 1px solid var(--sdc-border);
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
}

.sdc-faq-item summary {
    cursor: pointer;
    padding: 13px 16px;
    font-weight: 600;
    background: var(--sdc-soft);
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.sdc-faq-item summary::-webkit-details-marker { display: none; }
.sdc-faq-item summary::after { content: '+'; font-weight: 700; color: var(--sdc-muted); }
.sdc-faq-item[open] summary::after { content: '\2013'; }
.sdc-faq-answer { padding: 6px 16px 15px; line-height: 1.68; }

/* -------------------------------------------------------- Karriere ----- */

.sdc-career { list-style: none; margin: 0; padding: 0; }

.sdc-career li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 11px 0;
    border-bottom: 1px solid var(--sdc-soft);
}

.sdc-career li:last-child { border-bottom: none; }

.sdc-career li.is-active {
    background: color-mix(in srgb, var(--sdc-primary) 7%, transparent);
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
    border-radius: 9px;
}

.sdc-career-club { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.sdc-career-club img { width: 26px; height: 26px; object-fit: contain; }
.sdc-career-club a { color: inherit; text-decoration: none; }
.sdc-career-club a:hover { text-decoration: underline; }
.sdc-career-meta { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--sdc-muted); flex-wrap: wrap; }
.sdc-career-nr { background: var(--sdc-soft); border-radius: 999px; padding: 2px 9px; font-weight: 700; }

/* ------------------------------------------------------ Spielerfoto ---- */

.sdc-p-photo {
    flex: 0 0 auto;
    width: 132px;
    height: 132px;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 6px 22px rgba(0, 0, 0, .18);
}

.sdc-p-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.sdc-p-photo-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 54px;
}

/* ------------------------------------------------------------- Leer ---- */

.sdc-p-empty {
    color: var(--sdc-muted);
    font-size: 14px;
    margin: 0;
    padding: 6px 0;
}

/* ----------------------------------------------------------- Dunkel ---- */

@media (prefers-color-scheme: dark) {
    .sdc-p:not([data-theme="light"]) {
        --sdc-surface: #111827;
        --sdc-border: #1f2937;
        --sdc-soft: #1a2333;
        --sdc-text: #f8fafc;
        --sdc-muted: #94a3b8;
    }
}

[data-theme="dark"] .sdc-p {
    --sdc-surface: #111827;
    --sdc-border: #1f2937;
    --sdc-soft: #1a2333;
    --sdc-text: #f8fafc;
    --sdc-muted: #94a3b8;
}

[data-theme="dark"] .sdc-p-mscore.win { background: #052e16; color: #4ade80; }
[data-theme="dark"] .sdc-p-mscore.draw { background: #422006; color: #fcd34d; }
[data-theme="dark"] .sdc-p-mscore.loss { background: #450a0a; color: #f87171; }

/* ------------------------------------------------------------ Spiele --- */

.sdc-m-hero { padding-bottom: 18px; }

.sdc-m-scoreboard {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
}

.sdc-m-side { min-width: 0; text-align: center; }
.sdc-m-side a { color: inherit; text-decoration: none; display: block; }
.sdc-m-side a:hover .sdc-m-name { text-decoration: underline; }

.sdc-m-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 78px;
    height: 78px;
    margin: 0 auto 9px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .95);
    padding: 10px;
    font-size: 34px;
    box-shadow: 0 5px 18px rgba(0, 0, 0, .16);
}

.sdc-m-logo img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }

.sdc-m-name {
    display: block;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.28;
    color: #fff;
    overflow-wrap: anywhere;
}

.sdc-m-center { text-align: center; min-width: 108px; }
.sdc-m-center .sdc-p-eyebrow { margin-bottom: 6px; }

.sdc-m-score {
    margin: 0;
    font-size: clamp(30px, 6vw, 46px);
    font-weight: 800;
    line-height: 1;
    color: #fff;
    letter-spacing: .02em;
}

.sdc-m-kickoff {
    margin: 0;
    font-size: clamp(24px, 5vw, 34px);
    font-weight: 800;
    line-height: 1;
    color: #fff;
}

.sdc-m-ht { margin: 5px 0 0; font-size: 13px; opacity: .8; }
.sdc-m-date { margin: 7px 0 0; font-size: 13px; opacity: .85; }

.sdc-m-title {
    position: relative;
    margin: 18px 0 0;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, .18);
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    color: #fff;
    opacity: .9;
}

@media (max-width: 560px) {
    .sdc-m-logo { width: 60px; height: 60px; }
    .sdc-m-name { font-size: 13px; }
    .sdc-m-scoreboard { gap: 9px; }
}
