/* EA Sports FIFA Manager 13 / Career Mode Style */
:root {
    --bg-main: #000000;
    --box-bg: linear-gradient(180deg, #333333 0%, #111111 100%);
    --box-bg-light: linear-gradient(180deg, #4d4d4d 0%, #2a2a2a 100%);
    --box-border: #555555;
    --border-highlight: #888888;
    --topbar-red: linear-gradient(180deg, #d31f26 0%, #7d0e12 100%);
    --topbar-border: #4a0204;
    --btn-silver: linear-gradient(180deg, #f5f5f5 0%, #a8a8a8 100%);
    --btn-silver-hover: linear-gradient(180deg, #ffffff 0%, #cccccc 100%);
    --btn-red: linear-gradient(180deg, #e3262e 0%, #9e1115 100%);
    --btn-red-hover: linear-gradient(180deg, #ff3b44 0%, #c4171d 100%);
    --text-light: #ffffff;
    --text-muted: #b0b0b0;
    --text-dark: #111111;
    --pitch-green: linear-gradient(180deg, #22571b 0%, #11360c 100%);
    --success: #388e3c;
    --danger: #d32f2f;
    --warning: #f57c00;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-light);
    font-family: Arial, Helvetica, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-weight: bold;
    text-transform: uppercase;
}

/* EA Top Bar */
.ea-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--topbar-red);
    border-bottom: 3px solid var(--topbar-border);
    padding: 0.5rem 1rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.8);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 1rem;
}
.ea-logo-placeholder {
    background: white;
    color: #b31217;
    display: grid;
    place-items: center;
    flex: 0 0 92px;
    width: 92px;
    height: 92px;
    font-weight: 900;
    font-style: italic;
    border-radius: 50%;
    font-size: 1.85rem;
    line-height: 1;
    white-space: nowrap;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
}
.ea-title {
    font-size: clamp(1.35rem, 4vw, 2rem);
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px black;
    flex-grow: 1;
    margin-left: 0;
    line-height: 1.1;
    min-width: 0;
}
.ea-right-text {
    font-size: 0.9rem;
    font-weight: bold;
    color: #e0e0e0;
    white-space: nowrap;
}
.ea-top-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 0 0 auto;
}
.support-link {
    background: #ffdd00;
    color: #000;
    padding: 0.65rem 1rem;
    border-radius: 16px;
    font-weight: bold;
    font-size: 0.95rem;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

@media (max-width: 600px) {
    .ea-top-bar { padding: 0.4rem 0.6rem; gap: 0.5rem; }
    .ea-logo-placeholder {
        flex-basis: 52px;
        width: 52px;
        height: 52px;
        font-size: 1.05rem;
    }
    .ea-title { font-size: 1.05rem; line-height: 1.05; overflow: hidden; }
    .ea-right-text { display: none; }
    .ea-top-actions { gap: 0.4rem; }
    .changelog-btn { padding: 0.4rem 0.55rem; font-size: 0.75rem; }
    .support-link {
        padding: 0.45rem 0.65rem;
        border-radius: 14px;
        font-size: 0.8rem;
    }
}

@media (max-width: 400px) {
    .ea-logo-placeholder {
        flex-basis: 46px;
        width: 46px;
        height: 46px;
        font-size: 0.9rem;
    }
    /* Sehr schmal: Titel ausblenden, das 34-0-Logo reicht als Branding */
    .ea-title { display: none; }
    .changelog-btn { padding: 0.4rem 0.5rem; font-size: 0.72rem; }
    .support-link { padding: 0.4rem 0.55rem; font-size: 0.72rem; }
}

#app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* =========================================================================
   Desktop-Layout (themen-unabhängig: altes UND neues Design).
   Ziel: Viewport nutzen, möglichst kein Seiten-Scrollen; .active-scoped,
   damit das Ein-/Ausblenden der Screens nicht kaputtgeht.
   ========================================================================= */
@media (min-width: 1000px) {
    /* Start: zweispaltig (Auswahl | Rangliste), vertikal zentriert */
    #start-screen.active {
        display: grid;
        grid-template-columns: 1.5fr 1fr;
        column-gap: 2.5rem;
        row-gap: 0.5rem;
        align-items: start;
        align-content: center;
        max-width: 1200px;
        margin: 0 auto;
        min-height: calc(100vh - 90px);
    }
    #start-screen .logo-container { grid-column: 1 / -1; max-width: none; margin: 0 0 0.5rem; text-align: left; }
    #start-screen .preview-pitch-wrapper { height: 240px; }
    #start-leaderboard { align-self: stretch; }
    #start-leaderboard .lb-list { max-height: none; }

    /* Draft: Pitch links (höhenbegrenzt) + Steuerung rechts */
    #draft-screen.active {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-areas: "header header" "pitch controls";
        column-gap: 2rem;
        row-gap: 0.75rem;
        align-content: start;
        max-width: 1200px;
        margin: 0 auto;
    }
    #draft-screen .draft-header { grid-area: header; }
    #draft-screen .pitch-container {
        grid-area: pitch;
        height: calc(100vh - 170px);
        width: calc((100vh - 170px) * 2 / 3);
        aspect-ratio: auto;
        margin: 0;
        align-self: start;
    }
    #draft-screen .draft-controls { grid-area: controls; align-self: start; max-height: calc(100vh - 170px); overflow-y: auto; }
    #draft-screen .player-options { width: 100%; }

    /* Simulation: füllt die Höhe, scrollt nur intern */
    #simulation-screen.active { max-width: 1200px; margin: 0 auto; height: calc(100vh - 90px); display: flex; flex-direction: column; }
    #simulation-screen > h2 { flex: 0 0 auto; margin-bottom: 0.5rem; }
    #simulation-screen .sim-dashboard { flex: 1 1 auto; min-height: 0; grid-template-rows: 1fr; align-items: stretch; }
    #simulation-screen .sim-left, #simulation-screen .sim-right { display: flex; flex-direction: column; min-height: 0; max-height: 100%; overflow: hidden; }
    #simulation-screen .sim-header, #simulation-screen .sim-controls, #simulation-screen .sim-log-nav { flex: 0 0 auto; }
    #simulation-screen .table-container { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
    #simulation-screen .sim-log { flex: 1 1 auto; min-height: 0; max-height: none; }

    /* Result: Zusammenfassung links; Rangliste + Buttons rechts; Panels darunter */
    #result-screen.active {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 2rem;
        row-gap: 1rem;
        max-width: 1040px;
        margin: 1.5rem auto;
        align-items: start;
    }
    #result-screen.active > * { grid-column: 1 / -1; }
    #result-screen.active > #export-container { grid-column: 1; grid-row: 1 / span 2; }
    #result-screen.active > #leaderboard-card { grid-column: 2; grid-row: 1; margin-top: 0; }
    #result-screen.active > div:nth-child(3) { grid-column: 2; grid-row: 2; align-self: start; margin-top: 0; }
    #result-screen #final-team-list { max-width: 340px; }
}

/* Utilities */
.hidden { display: none !important; }

/* Metallic Card Box */
.card {
    background: var(--box-bg);
    border: 2px solid var(--box-border);
    border-top-color: var(--border-highlight);
    border-left-color: var(--border-highlight);
    border-radius: 4px;
    padding: 1rem;
    box-shadow: 4px 4px 10px rgba(0,0,0,0.8);
    margin-bottom: 1rem;
}
.card h2, .card h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #444;
    text-shadow: 1px 1px 1px black;
    font-size: 1.1rem;
}

.badge {
    background: #000;
    color: #fff;
    border: 1px solid #555;
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 2px;
    vertical-align: middle;
}

/* Buttons - Silver Metallic */
.btn {
    display: inline-block;
    padding: 0.6rem 1rem;
    border: 1px solid #666;
    border-radius: 20px; /* Pill shape like FIFA menus */
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.1s ease;
    text-align: center;
    width: 100%;
    color: var(--text-dark);
    text-shadow: 1px 1px 0px rgba(255,255,255,0.5);
    box-shadow: 0 2px 4px rgba(0,0,0,0.5), inset 0 1px 2px rgba(255,255,255,0.8);
}
.primary-btn { background: var(--btn-silver); }
.primary-btn:hover { background: var(--btn-silver-hover); }
.primary-btn:active { box-shadow: inset 0 2px 5px rgba(0,0,0,0.5); transform: translateY(1px); }

.secondary-btn { background: var(--box-bg-light); color: white; text-shadow: 1px 1px 0px black; border-color: #222; }
.secondary-btn:hover { background: var(--box-bg); }

.success-btn { background: var(--btn-red); color: white; text-shadow: 1px 1px 0px black; border-color: #4a0204; }
.success-btn:hover { background: var(--btn-red-hover); }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Screens */
.screen { display: none; animation: fadeIn 0.3s ease forwards; }
.screen.active { display: block; }
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Start Screen */
#start-screen {
    text-align: center;
    max-width: 600px;
    margin: 2rem auto;
}
.logo-container h1 {
    font-size: 4rem;
    color: white;
    text-shadow: 0 0 10px rgba(255,255,255,0.3), 2px 2px 0px var(--danger);
    margin-bottom: 0.5rem;
}
.logo-container p { color: var(--text-muted); margin-bottom: 0.5rem; font-weight: bold; }
.disclaimer { font-size: 0.7rem; color: #666; margin-bottom: 1.5rem; line-height: 1.2; }

.selection-container h2 {
    text-align: left;
    font-size: 1rem;
    color: var(--text-muted);
    border: none;
    margin: 1.5rem 0 0.5rem;
}

.league-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
@media (min-width: 600px) {
    .league-cards { grid-template-columns: 1fr 1fr 1fr; }
}
.difficulty-cards { 
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
@media (min-width: 600px) {
    .difficulty-cards { grid-template-columns: 1fr 1fr 1fr; }
}

.card.league-card, .card.diff-card {
    background: var(--box-bg-light);
    cursor: pointer;
    border: 2px solid #222;
    padding: 1rem;
    text-align: left;
    margin-bottom: 0;
}
.card.league-card:hover:not(.disabled), .card.diff-card:hover {
    border-color: #777;
    background: var(--box-bg);
}
.card.league-card.active, .card.diff-card.active {
    border-color: #d31f26;
    background: linear-gradient(180deg, #3a0000 0%, #1a0000 100%);
}
.card.disabled { opacity: 0.5; cursor: not-allowed; }
.card h3 { margin-bottom: 0.3rem; border: none; font-size: 1rem; color: white; }
.card p { font-size: 0.75rem; color: var(--text-muted); }

.formation-selection select {
    width: 100%;
    padding: 0.8rem;
    background: #111;
    border: 2px solid #444;
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    outline: none;
    cursor: pointer;
}

.preview-pitch-wrapper {
    margin-top: 0.5rem;
    height: 120px;
    background: var(--pitch-green);
    border: 2px solid #111;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
    border-radius: 4px;
}
.preview-pitch-wrapper::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(0deg, transparent, transparent 10%, rgba(0,0,0,0.15) 10%, rgba(0,0,0,0.15) 20%);
    z-index: 0;
}
.preview-dot {
    position: absolute;
    width: 12px; height: 12px;
    background: var(--btn-red);
    border: 2px solid white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    box-shadow: 0 0 3px black;
}
/* Feldmarkierungen: Mittellinie + Mittelkreis (über den Streifen, unter den Dots) */
.preview-pitch-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(rgba(255,255,255,0.45), rgba(255,255,255,0.45)) center / 100% 2px no-repeat,
        radial-gradient(circle at 50% 50%, transparent 22px, rgba(255,255,255,0.45) 22px 24px, transparent 24px);
}

/* Liga-Logo in den Modus-Karten */
.league-card-logo {
    display: block;
    height: 56px;
    margin: 0 auto 0.5rem;
    object-fit: contain;
}

/* Draft Screen */
#draft-screen header {
    background: var(--box-bg);
    border: 1px solid var(--box-border);
    padding: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.header-top h2 { margin: 0; font-size: 1.1rem; text-shadow: 1px 1px 1px black; }
.rerolls-container { font-weight: bold; font-size: 0.9rem; color: var(--text-muted); }
.draft-progress { font-weight: bold; font-size: 0.9rem; color: white; }

.draft-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 900px) {
    .draft-layout { grid-template-columns: 1fr 1fr; }
}

/* Pitch */
.pitch-container {
    background: var(--pitch-green);
    border: 4px solid #111;
    position: relative;
    overflow: hidden;
    padding: 1rem;
    aspect-ratio: 2 / 3;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.8), 0 5px 15px rgba(0,0,0,0.8);
}
/* Retro Pitch Pattern (dark/light green stripes) */
.pitch-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 10%,
        rgba(0,0,0,0.15) 10%,
        rgba(0,0,0,0.15) 20%
    );
    z-index: 0;
}
/* Pitch Markings (Subtle opacity) */
.pitch-container::after {
    content: '';
    position: absolute;
    top: 50%; left: 0; right: 0; height: 2px;
    background: rgba(255,255,255,0.3);
    z-index: 1;
}
.pitch { position: relative; width: 100%; height: 100%; z-index: 2; }
.pitch::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 60px; height: 60px;
    border-radius: 50%; border: 2px solid rgba(255,255,255,0.3);
}

.pitch-slot {
    position: absolute;
    width: clamp(40px, 14vw, 65px); 
    aspect-ratio: 3/4;
    background: rgba(0,0,0,0.7);
    border: 1px solid #555;
    transform: translate(-50%, -50%);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    transition: all 0.2s;
    cursor: pointer;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.5);
    padding: 2px;
}
.pitch-slot:hover:not(.filled) {
    background: rgba(30,30,30,0.9);
    border-color: #888;
}
.pitch-slot.slot-selected {
    background: var(--topbar-red);
    border: 2px solid white;
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 0 10px rgba(211, 31, 38, 0.8);
    z-index: 10;
}
.pitch-slot.slot-highlight {
    background: rgba(56, 142, 60, 0.8);
    border: 2px solid #a5d6a7;
    animation: pulse 1s infinite alternate;
    z-index: 10;
}
@keyframes pulse {
    from { box-shadow: 0 0 5px #388e3c; }
    to { box-shadow: 0 0 15px #a5d6a7; }
}

.pitch-slot.filled {
    background: var(--btn-silver);
    border: 1px solid #000;
    cursor: default;
    color: var(--text-dark);
}
.slot-pos { font-size: clamp(0.55rem, 2.5vw, 0.8rem); font-weight: bold; margin-bottom: 2px; text-shadow: none; color: inherit; }
.pitch-slot:not(.filled) .slot-pos { color: #fff; }
.slot-name { font-size: clamp(0.5rem, 2vw, 0.7rem); font-weight: bold; text-align: center; line-height: 1.05; overflow-wrap: anywhere; hyphens: auto; width: 100%; padding: 0 1px;}
.slot-rating { font-size: clamp(0.8rem, 3vw, 1.1rem); font-weight: 900; margin-top: 2px; color: #b31217;}
.slot-logo { width: clamp(16px, 5vw, 24px); height: clamp(16px, 5vw, 24px); object-fit: contain; margin-top: 2px; }

/* Hidden Ratings */
.hide-rating .slot-rating, .hide-rating .player-opt-rating, .hide-rating .team-overall { display: none !important; }

/* Draft Actions */
.draft-action-container { display: flex; flex-direction: column; gap: 0.5rem; }
.draft-action-container h3 { text-align: center; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.5rem; border: none;}

.player-options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* List Items EA Style */
.player-opt-card, .manager-card {
    background: var(--box-bg-light);
    border: 1px solid #222;
    padding: 0.8rem;
    display: flex; align-items: center; justify-content: space-between;
    cursor: pointer;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.5);
}
.player-opt-card:nth-child(even), .manager-card:nth-child(even) {
    background: var(--box-bg);
}
.player-opt-card:hover, .manager-card:hover {
    background: #444;
    border-color: #888;
}
.player-opt-logo { width: 35px; height: 35px; object-fit: contain; margin-right: 1rem; }
.player-opt-info { flex: 1; }
.player-opt-name { font-weight: bold; font-size: 1rem; color: white; }
.player-opt-meta { font-size: 0.8rem; color: var(--text-muted); }
.player-opt-rating { font-size: 1.3rem; font-weight: 900; color: #e3262e; text-shadow: 1px 1px 1px black;}

/* Manager Screen */
#manager-screen { max-width: 800px; margin: 0 auto; }
.manager-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    border: 2px solid var(--box-border);
}
@media (min-width: 600px) {
    .manager-list { grid-template-columns: 1fr 1fr; }
}
.manager-card { flex-direction: column; align-items: flex-start; gap: 0.2rem; }
.manager-card h4 { margin: 0; font-size: 1rem; color: white;}
.manager-card p { font-size: 0.8rem; color: var(--text-muted); margin: 0;}
.manager-bonus { font-size: 1.1rem; font-weight: bold; margin-top: 0.5rem; }
.bonus-pos { color: var(--success); }
.bonus-neg { color: var(--danger); }

/* Simulation Screen */
.sim-header {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--box-bg); border: 1px solid var(--box-border); padding: 0.8rem; margin-bottom: 1rem;
}
.team-overall {
    font-size: 1rem; font-weight: bold; color: white;
    background: #222; border: 1px solid #444; padding: 0.4rem 0.8rem;
}

.sim-layout, .sim-dashboard { display: grid; grid-template-columns: 1fr; gap: 1rem; align-items: start; }
@media (min-width: 900px) {
    .sim-layout, .sim-dashboard { grid-template-columns: 2fr 1fr; }
}

.table-container { overflow-x: auto; padding: 0; -webkit-overflow-scrolling: touch; }
.league-table { width: 100%; border-collapse: collapse; font-size: clamp(0.65rem, 2vw, 0.85rem); white-space: nowrap; }
.league-table th, .league-table td { padding: clamp(0.2rem, 1vw, 0.5rem); text-align: left; border-bottom: 1px solid #222; }
.league-table th { background: linear-gradient(180deg, #555 0%, #333 100%); color: white; font-size: clamp(0.6rem, 1.5vw, 0.75rem); border-bottom: 2px solid #111;}
.league-table tr:nth-child(even) { background: #1a1a1a; }
.league-table tr:hover { background: #333; }
.league-table tr.player-team { background: rgba(211, 31, 38, 0.2); font-weight: bold; border-left: 3px solid #d31f26; }
.team-cell { display: flex; align-items: center; gap: 0.5rem; }
.team-cell img { width: 16px; height: 16px; object-fit: contain; }

.match-events-container { padding: 0; }
.sim-log { max-height: 400px; overflow-y: auto; background: #000; padding: 0.5rem; text-align: center; }
.match-result { font-size: 0.8rem; padding: 0.5rem; border: none; border-bottom: 1px solid #222; text-align: center; }
.match-result.win { color: #a5d6a7; }
.match-result.draw { color: #ffe082; }
.match-result.loss { color: #ef9a9a; }
.sim-controls { padding: 1rem; background: var(--box-bg); display: flex; gap: 0.5rem; flex-direction: column; }

/* Result Screen */
#result-screen { text-align: center; max-width: 600px; margin: 2rem auto; }
#result-screen h1 { font-size: 2.5rem; color: #e3262e; text-shadow: 2px 2px 0px #000; margin-bottom: 1rem; }
.final-score { margin-bottom: 2rem; }
.final-score h2 { font-size: 2rem; color: white; margin-bottom: 1rem; }
.stats-row { display: flex; justify-content: center; gap: 1.5rem; font-size: 1.5rem; margin-bottom: 1.5rem; font-weight: bold; }
#final-w { color: var(--success); }
#final-d { color: var(--warning); }
#final-l { color: var(--danger); }
#result-message { color: var(--text-muted); font-size: 1.1rem; }
#final-team-list {
    position: relative;
    overflow: hidden;
    background: var(--pitch-green);
    border: 4px solid #111;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.8);
}
#final-team-list::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 10%,
        rgba(0,0,0,0.15) 10%,
        rgba(0,0,0,0.15) 20%
    );
    z-index: 0;
}
#final-team-list::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    background: rgba(255,255,255,0.3);
    z-index: 1;
}
.final-pitch {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 2;
}
.final-pitch .pitch-slot {
    width: clamp(42px, 12vw, 62px);
    cursor: default;
}
.final-team-fallback-list {
    position: absolute;
    inset: 1rem;
    z-index: 3;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-content: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    text-align: left;
}
.final-team-fallback-list div {
    background: rgba(0,0,0,0.7);
    border: 1px solid #555;
    padding: 0.35rem;
}
.final-team-fallback-list span {
    float: right;
    color: #ffdddd;
    font-weight: bold;
}

/* Leaderboard (mobile-first) */
.lb-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
    margin-bottom: 0.5rem;
}
.lb-chip {
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    border: 1px solid #444;
    background: #1a1a1a;
    color: #ccc;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: inherit;
}
.lb-chip.active {
    background: #e3262e;
    border-color: #e3262e;
    color: #fff;
    font-weight: bold;
}
.lb-status {
    font-size: 0.8rem;
    text-align: center;
    min-height: 1.1rem;
    margin-bottom: 0.5rem;
    color: #aaa;
}
.lb-list {
    list-style: none;
    padding: 0;
    margin: 0;
    /* Ab ~10 Einträgen scrollen, damit die Seite nicht zu lang wird */
    max-height: 360px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.lb-list::-webkit-scrollbar { width: 8px; }
.lb-list::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }
.lb-list::-webkit-scrollbar-track { background: transparent; }
.lb-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.4rem;
    border-bottom: 1px solid #2a2a2a;
    font-size: 0.85rem;
}
.lb-row .lb-rank { width: 1.9rem; text-align: center; flex-shrink: 0; }
.lb-row .lb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lb-row .lb-rec { font-size: 0.7rem; color: #888; flex-shrink: 0; }
.lb-row .lb-pts { font-weight: bold; min-width: 3rem; text-align: right; flex-shrink: 0; }
.lb-row.me {
    background: rgba(227, 38, 46, 0.18);
    border-radius: 6px;
    border-bottom-color: transparent;
}
.lb-sep { text-align: center; color: #555; padding: 0.2rem; }

/* Changelog Button + Modal */
.changelog-btn {
    background: #2a2a2a;
    color: #fff;
    border: 1px solid #555;
    padding: 0.5rem 0.8rem;
    border-radius: 14px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
}
.changelog-btn:hover { background: #3a3a3a; border-color: #888; }
.changelog-version { color: #9aa0a6; font-weight: normal; font-size: 0.75rem; }

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
}
.modal-box {
    background: var(--box-bg, #1a1a1a);
    border: 1px solid #444;
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #333;
}
.modal-head h3 { margin: 0; color: #fff; font-size: 1.1rem; }
.modal-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.3rem;
}
.modal-close:hover { color: #fff; }
.modal-body { padding: 1rem; overflow-y: auto; }

.cl-entry { margin-bottom: 1.25rem; }
.cl-entry:last-child { margin-bottom: 0; }
.cl-head { display: flex; align-items: baseline; gap: 0.6rem; margin-bottom: 0.4rem; }
.cl-version { color: #e3262e; font-weight: bold; font-size: 1rem; }
.cl-date { color: #888; font-size: 0.8rem; }
.cl-list { margin: 0; padding-left: 1.1rem; }
.cl-list li { color: #ddd; font-size: 0.88rem; margin-bottom: 0.3rem; line-height: 1.35; }

@media (max-width: 600px) {
    .changelog-version { display: none; }
}
