/*
 * DWWV Ranking – Öffentliche Ranglisten-Seite (ranking/index.blade.php)
 * Ergänzt /css/dwwv-theme.css mit seitenspezifischen Styles.
 */

/* Inline critical CSS for fast render */
body {
    font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    background: #151521;
    color: #f0f6fc;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main { flex: 1; }

/* Sport Toggle */
.sport-toggle {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-top: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 4px;
    display: inline-flex;
}

.sport-toggle-wrapper {
    display: flex;
    justify-content: center;
}

.sport-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sport-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.sport-btn.active {
    background: linear-gradient(135deg, #009ef7 0%, #0078c8 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 158, 247, 0.3);
}

@media (max-width: 600px) {
    .sport-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
}

/* Gender Toggle */
.gender-toggle-wrapper {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

.gender-toggle {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 3px;
}

.gender-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1.5rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* SVG-Asset statt Inline-Zeichen ♂/♀ (wie bei den Flaggen, siehe components/flag.blade.php):
   die Symbole liegen in keiner Textschrift, iOS holte sie aus einer Ersatzschrift mit
   eigenen Metriken – dadurch saßen sie sichtbar zu tief. Ein Bild hat feste Maße und
   wird vom flex align-items: center des Buttons exakt mittig gesetzt. */
.gender-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.gender-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.gender-btn.active {
    background: #fff;
    color: #1e1e2d;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.gender-btn.active .gender-icon {
    color: #009ef7;
}


/* Category Tabs */
.category-tabs {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    padding: 1rem;
    margin: -3rem auto 0;
    max-width: 900px;
    position: relative;
    z-index: 20;
    flex-wrap: wrap;
    background: rgba(22, 27, 34, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid #2b2b40;
}

.category-tab {
    padding: 0.625rem 1.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #8b949e;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.category-tab:hover {
    color: #f0f6fc;
    background: rgba(255, 255, 255, 0.1);
}

.category-tab.active {
    background: linear-gradient(135deg, #009ef7, #0078c8);
    color: #fff;
}

/* Compact Filter Bar */
.filter-bar {
    max-width: 900px;
    margin: 1rem auto 2rem;
    padding: 0 1rem;
}

.filter-form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-item {
    flex: 1;
    min-width: 180px;
}

.filter-item select {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    background: #1e1e2d;
    border: 1px solid #2b2b40;
    border-radius: 8px;
    color: #f0f6fc;
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238b949e' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    transition: all 0.2s ease;
}

.filter-item select:hover {
    border-color: #323248;
}

.filter-item select:focus {
    outline: none;
    border-color: #009ef7;
    box-shadow: 0 0 0 3px rgba(0, 158, 247, 0.2);
}

.filter-search {
    flex: 2;
    min-width: 220px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: #6e7681;
    pointer-events: none;
}

.search-input-wrapper input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    background: #1e1e2d;
    border: 1px solid #2b2b40;
    border-radius: 8px;
    color: #f0f6fc;
    font-size: 0.875rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.search-input-wrapper input::placeholder {
    color: #6e7681;
}

.search-input-wrapper input:hover {
    border-color: #323248;
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: #009ef7;
    box-shadow: 0 0 0 3px rgba(0, 158, 247, 0.2);
}

.filter-reset {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: #f85149;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.filter-reset:hover {
    background: rgba(248, 81, 73, 0.1);
}

@media (max-width: 640px) {
    .category-tabs {
        margin: -2rem 0.5rem 0;
        padding: 0.75rem;
        gap: 0.25rem;
    }

    .category-tab {
        padding: 0.5rem 0.875rem;
        font-size: 0.75rem;
    }

    .filter-bar {
        padding: 0 0.5rem;
    }

    .filter-form {
        flex-direction: column;
    }

    .filter-item,
    .filter-search {
        width: 100%;
        min-width: unset;
    }

    .filter-reset {
        width: 100%;
        justify-content: center;
        background: rgba(248, 81, 73, 0.1);
    }
}

/* Clickable Rows */
.rider-row {
    cursor: pointer;
    transition: all 0.15s ease;
}

.rider-row:hover {
    background: rgba(0, 158, 247, 0.08) !important;
}

.rider-row:active {
    background: rgba(0, 158, 247, 0.12) !important;
}

.rider-row:focus {
    outline: 2px solid #009ef7;
    outline-offset: -2px;
}

.rider-name {
    font-weight: 700;
    color: var(--text-primary, #f0f6fc);
}

/* ================================
   RIDER PROFILE SLIDE PANEL
   ================================ */
.rider-panel {
    position: fixed;
    inset: 0;
    z-index: 1000;
    pointer-events: none;
    visibility: hidden;
}

.rider-panel.open {
    pointer-events: auto;
    visibility: visible;
}

.panel-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rider-panel.open .panel-overlay {
    opacity: 1;
}

.panel-content {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    max-width: 520px;
    background: linear-gradient(180deg, #151521 0%, #1b1b29 100%);
    border-left: 1px solid #2b2b40;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.rider-panel.open .panel-content {
    transform: translateX(0);
}

.panel-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.panel-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.panel-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    height: 300px;
    color: #8b949e;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #2b2b40;
    border-top-color: #009ef7;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.panel-body {
    padding: 1.5rem;
    flex: 1;
}

/* Profile Header */
.profile-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 2rem 1.5rem;
    background: linear-gradient(135deg, rgba(0, 158, 247, 0.15) 0%, rgba(0, 158, 247, 0.05) 100%);
    border-bottom: 1px solid #2b2b40;
}

.profile-rank {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #009ef7 0%, #0078c8 100%);
    color: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 158, 247, 0.4);
}

.profile-rank.gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffb300 100%);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
}

.profile-rank.silver {
    background: linear-gradient(135deg, #c0c0c0 0%, #a0a0a0 100%);
    box-shadow: 0 4px 20px rgba(192, 192, 192, 0.4);
}

.profile-rank.bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #b87333 100%);
    box-shadow: 0 4px 20px rgba(205, 127, 50, 0.4);
}

.profile-identity {
    flex: 1;
    min-width: 0;
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.profile-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}

.profile-badge.category {
    background: rgba(0, 158, 247, 0.2);
    color: #009ef7;
    border: 1px solid rgba(0, 158, 247, 0.3);
}

/* Stats Cards */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 1.5rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #2b2b40;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.stat-card.primary {
    grid-column: span 2;
    background: linear-gradient(135deg, rgba(0, 200, 83, 0.15) 0%, rgba(0, 200, 83, 0.05) 100%);
    border-color: rgba(0, 200, 83, 0.3);
}

.stat-card.primary .stat-value {
    font-size: 2.5rem;
    color: #50cd89;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
}

/* Profile Details */
.profile-details {
    padding: 0 1.5rem;
    margin-bottom: 1.5rem;
}

.profile-details h3,
.profile-results h3 {
    font-size: 0.875rem;
    font-weight: 700;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 1rem 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #2b2b40;
    border-radius: 10px;
}

.detail-icon {
    font-size: 1.25rem;
}

.detail-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.detail-label {
    font-size: 0.6875rem;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.detail-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #f0f6fc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Results Timeline */
.profile-results {
    padding: 0 1.5rem 2rem;
}

.results-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #2b2b40;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.result-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: #2b2b40;
}

.result-placement {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    background: #2b2b40;
    color: #f0f6fc;
    border-radius: 10px;
    flex-shrink: 0;
}

.result-placement.top-1 {
    background: linear-gradient(135deg, #ffd700, #ffb300);
    color: #1e1e2d;
}

.result-placement.top-2 {
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
    color: #1e1e2d;
}

.result-placement.top-3 {
    background: linear-gradient(135deg, #cd7f32, #b87333);
    color: #fff;
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-event {
    font-size: 0.875rem;
    font-weight: 600;
    color: #f0f6fc;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-meta {
    font-size: 0.75rem;
    color: #8b949e;
}

.result-stars {
    margin-left: 0.5rem;
    color: #ffd700;
}

/* Herkunft des Ergebnisses. Die Platzierung eines internationalen Wettkampfs ist
   eine IWWF-Platzierung – in der Rangliste stehen davor nur die deutschen Fahrer. */
.result-scope {
    margin-left: 0.5rem;
    padding: 0.05rem 0.4rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.result-scope.international {
    background: rgba(255, 82, 82, 0.15);
    border: 1px solid rgba(255, 82, 82, 0.4);
    color: #ff8a80;
}

.result-points {
    font-size: 1rem;
    font-weight: 700;
    color: #50cd89;
    flex-shrink: 0;
}

.no-results {
    text-align: center;
    color: #8b949e;
    padding: 2rem;
    font-size: 0.875rem;
}

/* Panel Responsive */
@media (max-width: 540px) {
    .panel-content {
        max-width: 100%;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
        padding: 3rem 1.5rem 1.5rem;
    }

    .profile-badges {
        justify-content: center;
    }

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

/* ================================
   LIGHT MODE
   ================================ */
@media (prefers-color-scheme: light) {
    :root {
        --bg-primary: #ffffff;
        --bg-secondary: #f6f8fa;
        --bg-tertiary: #f0f2f5;
        --bg-hover: #e8eaed;
        --border-color: #d0d7de;
        --border-light: #e1e4e8;
        --text-primary: #1f2328;
        --text-secondary: #57606a;
        --text-muted: #8b949e;
        --accent-primary: #009ef7;
        --accent-secondary: #cf222e;
    }

    body {
        background: var(--bg-secondary);
        color: var(--text-primary);
    }

    /* Hero Header Light */
    .hero-header {
        background: linear-gradient(135deg, #009ef7 0%, #0078c8 50%, #009ef7 100%);
    }

    .hero-title {
        color: #fff;
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    }

    .hero-subtitle {
        color: rgba(255, 255, 255, 0.9);
    }

    .hero-tagline {
        color: rgba(255, 255, 255, 0.75);
    }

    /* Sport Toggle Light */
    .sport-toggle {
        background: rgba(255, 255, 255, 0.2);
    }

    .sport-btn {
        color: rgba(255, 255, 255, 0.8);
    }

    .sport-btn:hover {
        background: rgba(255, 255, 255, 0.15);
        color: #fff;
    }

    .sport-btn.active {
        background: #fff;
        color: #009ef7;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    /* Gender Toggle Light */
    .gender-toggle {
        background: rgba(0, 0, 0, 0.08);
    }

    .gender-btn {
        color: var(--text-secondary);
    }

    .gender-icon {
        color: #009ef7;
    }

    .gender-btn:hover {
        color: var(--text-primary);
        background: rgba(0, 0, 0, 0.05);
    }

    .gender-btn.active {
        background: #009ef7;
        color: #fff;
        box-shadow: 0 2px 8px rgba(0, 158, 247, 0.3);
    }

    .gender-btn.active .gender-icon {
        color: #fff;
    }

    /* Category Tabs Light */
    .category-tabs {
        background: var(--bg-primary);
        border-color: var(--border-color);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .category-tab {
        color: var(--text-secondary);
    }

    .category-tab:hover {
        color: var(--text-primary);
        background: var(--bg-tertiary);
    }

    .category-tab.active {
        background: #009ef7;
        color: #fff;
    }

    /* Filter Bar Light */
    .filter-item select,
    .search-input-wrapper input {
        background: var(--bg-primary);
        border-color: var(--border-color);
        color: var(--text-primary);
    }

    .filter-item select:hover,
    .search-input-wrapper input:hover {
        border-color: var(--text-muted);
    }

    .filter-item select:focus,
    .search-input-wrapper input:focus {
        border-color: #009ef7;
        box-shadow: 0 0 0 3px rgba(0, 158, 247, 0.15);
    }

    .search-icon {
        color: var(--text-muted);
    }

    /* Table Light */
    .ranking-table-container {
        background: var(--bg-primary);
        border-color: var(--border-color);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    }

    .ranking-table thead {
        background: var(--bg-tertiary);
    }

    .ranking-table th {
        color: var(--text-secondary);
        border-bottom-color: var(--border-color);
    }

    .ranking-table td {
        border-bottom-color: var(--border-light);
    }

    .rider-row:hover {
        background: rgba(0, 158, 247, 0.06) !important;
    }

    .rider-row:active {
        background: rgba(0, 158, 247, 0.1) !important;
    }

    .rider-row:focus {
        outline-color: #009ef7;
    }

    .rider-name {
        color: var(--text-primary);
    }

    .rider-meta {
        color: var(--text-muted);
    }

    .rank-badge {
        background: var(--bg-tertiary);
        color: var(--text-primary);
    }

    .rank-badge.top-10 {
        background: linear-gradient(135deg, #009ef7, #0078c8);
        color: #fff;
    }

    .badge-category {
        background: rgba(0, 158, 247, 0.1);
        color: #009ef7;
        border-color: rgba(0, 158, 247, 0.3);
    }

    .badge-nationality {
        background: var(--bg-tertiary);
        color: var(--text-secondary);
        border-color: var(--border-color);
    }

    .points-value {
        color: #47be7d;
    }

    .points-label {
        color: var(--text-muted);
    }

    /* Pagination Light */
    .pagination a,
    .pagination span {
        background: var(--bg-primary);
        border-color: var(--border-color);
        color: var(--text-secondary);
    }

    .pagination a:hover {
        background: var(--bg-tertiary);
        border-color: var(--text-muted);
    }

    .pagination .active {
        background: #009ef7;
        border-color: #009ef7;
        color: #fff;
    }

    /* Footer Light */
    .site-footer {
        background: var(--bg-primary);
        border-top-color: var(--border-color);
    }

    .footer-brand {
        color: var(--text-secondary);
    }

    .footer-update {
        background: rgba(26, 127, 55, 0.1);
        color: #47be7d;
    }

    .footer-update .pulse {
        background: #47be7d;
    }

    .footer-content {
        border-top-color: var(--border-light);
    }

    /* Ranking Explanation Light */
    .ranking-explanation {
        background: var(--bg-primary) !important;
        border-color: var(--border-color) !important;
    }

    .ranking-explanation summary {
        color: var(--text-primary) !important;
    }

    .ranking-explanation summary svg {
        color: #009ef7 !important;
        fill: #009ef7 !important;
    }

    .ranking-explanation > div {
        color: var(--text-secondary) !important;
    }

    .ranking-explanation strong {
        color: var(--text-primary) !important;
    }

    .ranking-explanation h4 {
        color: var(--text-primary) !important;
    }

    /* Cards inside ranking explanation */
    .ranking-explanation > div > div > div {
        background: var(--bg-secondary) !important;
        border-color: var(--border-color) !important;
    }

    .ranking-explanation table td {
        color: var(--text-secondary);
    }

    .ranking-explanation ol li {
        color: var(--text-secondary);
    }

    /* Info banner in explanation */
    .ranking-explanation [role="note"] {
        background: rgba(0, 158, 247, 0.08) !important;
        border-color: rgba(0, 158, 247, 0.3) !important;
    }

    .ranking-explanation [role="note"] svg {
        fill: #009ef7 !important;
        color: #009ef7 !important;
    }

    /* Panel Light Mode */
    .panel-content {
        background: linear-gradient(180deg, #ffffff 0%, #f6f8fa 100%);
        border-left-color: var(--border-color);
    }

    .panel-close {
        background: rgba(0, 0, 0, 0.05);
        border-color: rgba(0, 0, 0, 0.1);
        color: var(--text-primary);
    }

    .panel-close:hover {
        background: rgba(0, 0, 0, 0.1);
    }

    .profile-header {
        background: linear-gradient(135deg, rgba(0, 158, 247, 0.1) 0%, rgba(0, 158, 247, 0.03) 100%);
        border-bottom-color: var(--border-color);
    }

    .profile-rank {
        background: linear-gradient(135deg, #009ef7 0%, #0078c8 100%);
        color: #fff;
        box-shadow: 0 4px 20px rgba(0, 158, 247, 0.3);
    }

    .profile-name {
        color: var(--text-primary);
    }

    .profile-badge.category {
        background: rgba(0, 158, 247, 0.1);
        color: #009ef7;
        border-color: rgba(0, 158, 247, 0.3);
    }

    .stat-card {
        background: var(--bg-primary);
        border-color: var(--border-color);
    }

    .stat-card.primary {
        background: linear-gradient(135deg, rgba(26, 127, 55, 0.1) 0%, rgba(26, 127, 55, 0.03) 100%);
        border-color: rgba(26, 127, 55, 0.3);
    }

    .stat-card.primary .stat-value {
        color: #47be7d;
    }

    .stat-value {
        color: var(--text-primary);
    }

    .detail-item,
    .result-item {
        background: var(--bg-primary);
        border-color: var(--border-color);
    }

    .result-item:hover {
        background: var(--bg-secondary);
    }

    .detail-value,
    .result-event {
        color: var(--text-primary);
    }

    .result-placement {
        background: var(--bg-tertiary);
        color: var(--text-primary);
    }

    .result-points {
        color: #47be7d;
    }
}

/* Footer Container */
.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.site-footer {
    background: #1b1b29;
    border-top: 1px solid #2b2b40;
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

.site-footer .ranking-explanation {
    margin-bottom: 2rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid #2b2b40;
}

.footer-brand {
    font-size: 0.875rem;
    color: #8b949e;
}

.footer-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-update {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 200, 83, 0.1);
    border-radius: 9999px;
    font-size: 0.8125rem;
    color: #50cd89;
}

.footer-update .pulse {
    width: 8px;
    height: 8px;
    background: #50cd89;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

@media (max-width: 640px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

/* ========================================
   Ranking-Erklärung (components/ranking-explanation.blade.php)
   ======================================== */
.ranking-explanation {
    background: var(--color-bg-card, #1e1e2d);
    border: 1px solid var(--color-border, #2b2b40);
    border-radius: 16px;
    margin: 0 auto 2rem;
    max-width: 900px;
}

.ranking-explanation summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--color-text-primary, #f0f6fc);
    list-style: none;
    user-select: none;
}

.ranking-explanation summary::-webkit-details-marker { display: none; }
.ranking-explanation summary::marker { display: none; }

.ranking-explanation .chevron {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.ranking-explanation[open] .chevron { transform: rotate(180deg); }

.re-summary-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.re-icon {
    flex-shrink: 0;
    color: var(--color-primary-accent, #009ef7);
}

.re-body {
    padding: 0 1.5rem 1.5rem;
    color: var(--color-text-secondary, #8b949e);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.re-body strong { color: var(--color-text-primary, #f0f6fc); }

.re-intro { margin-bottom: 1.5rem; }

.re-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.re-card {
    background: var(--color-bg-elevated, #1b1b29);
    border: 1px solid var(--color-border, #2b2b40);
    border-radius: 12px;
    padding: 1.25rem;
}

.re-card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-primary, #f0f6fc);
}

/* Punkte-Tabelle (Platzierung × Star-Level) */
/* Sechs Star-Level passen auf schmalen Displays nicht nebeneinander:
   die Tabelle scrollt in ihrem eigenen Container, die Seite bleibt ruhig. */
.re-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.re-pointtable {
    width: 100%;
    min-width: 22rem;
    border-collapse: collapse;
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
}

.re-pointtable th {
    text-align: right;
    font-weight: 700;
    color: var(--color-text-muted, #6e7681);
    padding: 0.3rem 0.35rem;
    border-bottom: 1px solid var(--color-border, #2b2b40);
}

.re-pointtable th:first-child { text-align: left; }

.re-pointtable td {
    text-align: right;
    padding: 0.35rem;
    border-bottom: 1px solid var(--color-border, #2b2b40);
    color: var(--color-text-secondary, #8b949e);
}

.re-pointtable td:first-child {
    text-align: left;
    color: var(--color-text-primary, #f0f6fc);
    font-weight: 600;
}

.re-pointtable tbody tr:last-child td { border-bottom: none; }

.re-place-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.re-pointtable .re-medal { width: 18px; height: 18px; font-size: 0.65rem; }

.re-ellipsis td {
    text-align: center;
    color: var(--color-text-muted, #6e7681);
    padding: 0.15rem;
}

.re-note-hint {
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    color: var(--color-text-muted, #6e7681);
}

.re-medal {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.re-medal.gold { background: linear-gradient(135deg, #ffd700, #ffed4a); }
.re-medal.silver { background: linear-gradient(135deg, #c0c0c0, #e8e8e8); }
.re-medal.bronze { background: linear-gradient(135deg, #cd7f32, #daa06d); }

/* Star-Level */
.re-text { margin-bottom: 1rem; font-size: 0.875rem; }
.re-stars { display: flex; flex-direction: column; gap: 0.75rem; }

.re-star-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid;
}

.re-star-row.s6 { background: rgba(224, 64, 251, 0.12); border-color: rgba(224, 64, 251, 0.35); }
.re-star-row.s5 { background: rgba(255, 82, 82, 0.12); border-color: rgba(255, 82, 82, 0.35); }
.re-star-row.s4 { background: rgba(255, 215, 0, 0.12); border-color: rgba(255, 215, 0, 0.35); }
.re-star-row.s3 { background: rgba(255, 171, 0, 0.1); border-color: rgba(255, 171, 0, 0.3); }
.re-star-row.s2 { background: rgba(0, 176, 255, 0.1); border-color: rgba(0, 176, 255, 0.3); }
.re-star-row.s1 { background: var(--color-bg-hover, #2b2b40); border-color: var(--color-border, #2b2b40); }

.re-star-label { display: flex; align-items: center; gap: 0.5rem; }
.re-star-label .name { color: var(--color-text-primary, #f0f6fc); font-weight: 600; }

/* Kompakte Stufenangabe ("5★") statt einer Reihe Emojis – ab 4 Sternen
   sprengen wiederholte Symbole die Zeile. */
.re-star-level {
    min-width: 2.25rem;
    font-weight: 700;
    color: var(--color-text-primary, #f0f6fc);
}

.re-mult {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.875rem;
}

.re-mult.s6 { background: #e040fb; color: #000; }
.re-mult.s5 { background: #ff5252; color: #000; }
.re-mult.s4 { background: #ffd700; color: #000; }
.re-mult.s3 { background: #ffab00; color: #000; }
.re-mult.s2 { background: #00b0ff; color: #000; }
.re-mult.s1 { background: var(--color-border, #2b2b40); color: var(--color-text-primary, #f0f6fc); }

/* Tie-Breaker */
.re-tiebreak { margin: 0; padding-left: 1.25rem; font-size: 0.875rem; line-height: 2; }

/* Info-Banner */
.re-info {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    background: rgba(0, 158, 247, 0.1);
    border: 1px solid rgba(0, 158, 247, 0.3);
    border-radius: 10px;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.re-info .re-icon { margin-top: 2px; }

@media (max-width: 640px) {
    .ranking-explanation { margin: 0 0.5rem 1.5rem; }
}

/* ========================================
   Ranglisten-Tabelle – Spalten-/Layout-Klassen
   (ersetzt vormals inline style="" in ranking-table.blade.php)
   ======================================== */
.ranking-table .col-rank {
    width: 80px;
}

.ranking-table .col-points {
    text-align: right;
}

.mobile-badges {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
