.image-container { max-width: 300px; height: 300px; display: flex; align-items: center; justify-content: center; margin: 0 auto; }
.image-container img, .track-image { max-width: 100%; max-height: 100%; object-fit: contain; }
.stretched-link::after { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 1; content: ""; }
.clickable { cursor: pointer; }
.status-text.success { color: #28a745; font-weight: bold; }
.stats-list2 { display: flex; flex-direction: column; gap: 8px; padding-top: 20px; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.card {
    background: #1a1e2a;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.2s;
}

.card img {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.filter-container {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	background: #151922;
	padding: 20px 30px;
	border-radius: 12px;
	margin-bottom: 40px;
	align-items: center;
	border: 1px solid #1c222d;
}

.card p a, .filter-container a {
    color: #eaeaea;
    margin-left: 15px;
    text-decoration: none;
}

.card p a, .filter-container a:hover {
    color: #ff3b3b;
}

/* Der Container für die Stats */
.stats-list2 {
	display: flex;
	flex-direction: column;
	gap: 8px;
	text-align: left;
	
	/* NEU: Drückt diesen Block nach ganz unten */
	padding-top: 20px;
}

.stat-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 1px solid #2a2f3d;
	padding-bottom: 4px;
}

.stat-label {
	color: #888;
	font-size: 0.9rem;
}

.stat-value {
	color: #ff3b3b;
	font-weight: bold;
	font-size: 1rem;
}

/* Hervorhebung der Top 3 */
.rank-1 { background: rgba(255, 215, 0, 0.1); } /* Gold-Hauch */
.rank-2 { background: rgba(192, 192, 192, 0.08); } /* Silber-Hauch */
.rank-3 { background: rgba(205, 127, 50, 0.06); } /* Bronze-Hauch */

.rank-1 .pos-col { color: #ffd700; font-size: 1.1rem; }
.rank-2 .pos-col { color: #c0c0c0; }
.rank-3 .pos-col { color: #cd7f32; }

/* Standard Tabellen-Styles */
.race-table th {
    text-align: center;
    text-transform: uppercase;
    font-size: 0.7rem;
    color: #777;
    padding: 10px;
    border-bottom: 2px solid #444;
}

.race-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #222;
}

.time-col {
    text-align: center;
    font-family: 'Consolas', 'Courier New', monospace;
    color: #00ffcc;
    font-weight: bold;
    white-space: nowrap;
}

/* Powerup Styling */
.powerup-container {
    display: flex;
    gap: 4px;
    justify-content: center;
    flex-wrap: wrap;
    min-width: 80px;
}

.pu-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.5));
    transition: transform 0.2s;
}

.pu-icon:hover {
    transform: scale(1.5);
    z-index: 10;
}

/* Tabellenspalte für Powerups schmal halten */
.pu-col {
    width: 100px;
    text-align: center;
}

/* Zentrierung der Tabellen */
.table-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
}

.race-table {
    margin: 0 auto;
    width: 95%;
}

/* --- NEUE ANPASSUNGEN FÜR MOBILE OPTIMIERUNG --- */

/* Verhindert, dass die Tabellen-Wrapper das Layout sprengen */
.table-wrapper {
    overflow-x: auto;
    display: block; /* Überschreibt das flex-center für bessere Scroll-Performance auf Mobile */
}

/* Stil für den Upland-Link Button */
.upland-btn {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 15px;
    background: #1c222d;
    border: 1px solid #ff3b3b;
    border-radius: 6px;
    color: #ff3b3b !important;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.upland-btn:hover {
    background: #ff3b3b;
    color: #fff !important;
}

/* Die magische Transformation: Tabelle zu Cards auf Handys */
@media (max-width: 768px) {
    /* Header komplett verstecken */
    .race-table thead {
        display: none;
    }

    .race-table, .race-table tbody, .race-table tr, .race-table td {
        display: block;
        width: 100%;
    }

    .race-table tr {
        margin-bottom: 20px;
        border: 1px solid #2a2f3d;
        border-radius: 12px;
        background: #1e2330;
        overflow: hidden;
    }

    .race-table td {
        text-align: right;
        padding: 12px 15px;
        padding-left: 50%;
        position: relative;
        border-bottom: 1px solid #2a2f3d;
        min-height: 45px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    /* Das Label (data-label) links anzeigen */
    .race-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        width: 45%;
        text-align: left;
        font-weight: bold;
        color: #888;
        font-size: 0.75rem;
        text-transform: uppercase;
        white-space: nowrap;
    }

    /* Spezial-Handling für Spalten mit viel Text oder Icons */
    .race-table td.driver-name, 
    .race-table td.time-col {
        flex-direction: column;
        align-items: flex-end;
        height: auto;
        padding-top: 15px;
        padding-bottom: 15px;
    }

    .race-table td.pu-col {
        justify-content: flex-end;
    }

    .powerup-container {
        justify-content: flex-end;
    }

    /* Letzte Zeile in der Card braucht keinen Border-Bottom */
    .race-table td:last-child {
        border-bottom: none;
        background: rgba(255, 59, 59, 0.05); /* Highlight für die letzte Spalte */
    }

    /* Top 3 Markierung auch mobil deutlicher machen */
    .rank-1 { border-color: #ffd700 !important; }
    .rank-2 { border-color: #c0c0c0 !important; }
    .rank-3 { border-color: #cd7f32 !important; }
}