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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.background-waves {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.background-waves::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(138, 43, 226, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(75, 0, 130, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(148, 0, 211, 0.12) 0%, transparent 50%);
    animation: waveFloat 40s ease-in-out infinite;
}

@keyframes waveFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(5%, 5%) rotate(120deg); }
    66% { transform: translate(-5%, 3%) rotate(240deg); }
}

.nav-tabs {
    position: relative;
    z-index: 10;
    display: flex;
    gap: 8px;
    padding: 20px 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-tab {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.nav-tab:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
    color: #ffffff;
    background: rgba(138, 43, 226, 0.2);
}

.container {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

h1 {
    font-size: 48px;
    font-weight: 200;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.games-feed {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.game-card {
    background: rgba(26, 26, 26, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease forwards;
    position: relative;
    overflow: visible;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-card:hover {
    border-color: rgba(138, 43, 226, 0.3);
    box-shadow: 0 8px 32px rgba(138, 43, 226, 0.1);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.game-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.game-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.game-number {
    font-size: 24px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.95);
}

.game-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.game-badge.player-count {
    background: rgba(100, 149, 237, 0.2);
    color: rgba(135, 206, 250, 1);
    border: 1px solid rgba(100, 149, 237, 0.4);
}

.game-badge.multi-elimination {
    background: rgba(220, 20, 60, 0.2);
    color: rgba(255, 99, 71, 1);
    border: 1px solid rgba(220, 20, 60, 0.4);
}

.game-date {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

.game-date-below {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 4px;
    text-align: right;
    font-style: italic;
    width: 100%;
}

.color-circles {
    display: flex;
    gap: 4px;
}

.color-circle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.game-content {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.players-list {
    flex: 0 0 auto;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sankey-container {
    flex: 1 1 300px;
    min-width: 300px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    padding: 0 12px 0 0;
    overflow: visible;
}

@media (max-width: 768px) {
    .sankey-container {
        flex: 1 1 100%;
        width: 100%;
        min-width: 100%;
    }
    
    .players-list {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

.sankey-diagram {
    width: 100%;
    height: auto;
    display: block;
    max-height: 600px;
}

.no-sankey {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    text-align: center;
    font-style: italic;
}

.game-insights {
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(40, 35, 30, 0.5);
    border-radius: 6px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    border: 1px solid rgba(139, 115, 85, 0.3);
    text-align: center;
}

.player-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.player-entry:has(.finish-position.first) {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.08) 0%, rgba(255, 165, 0, 0.05) 50%, transparent 100%);
    border-left: 3px solid rgba(255, 215, 0, 0.4);
    padding-left: 12px;
}

.player-entry:has(.finish-position.first) .commander-name {
    font-weight: 600;
    color: #FFE97F;
}

.finish-position {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.finish-position.first {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.6),
        0 0 40px rgba(255, 215, 0, 0.3),
        0 4px 8px rgba(0, 0, 0, 0.3);
    font-size: 15px;
    font-weight: 700;
    position: relative;
    z-index: 2;
}

.finish-position.first::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #FFD700, #FFA500, #FFD700, #FFA500);
    background-size: 300% 300%;
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 0.3;
    }
}

.finish-position.first:hover::before {
    opacity: 0.5;
}

.finish-position.second {
    background: linear-gradient(135deg, #C0C0C0, #808080);
    color: #000;
}

.finish-position.third {
    background: linear-gradient(135deg, #CD7F32, #8B4513);
    color: #fff;
}

.finish-position.other {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.player-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.commander-name {
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    line-height: 1.3;
    margin-bottom: 2px;
}

.player-inline {
    font-size: 13px;
    font-weight: 400;
    font-style: italic;
    color: rgba(255, 255, 255, 0.6);
}

.insight-badge.sol-ring {
    background: rgba(192, 192, 192, 0.2);
    color: rgba(211, 211, 211, 1);
    border: 1px solid rgba(192, 192, 192, 0.4);
}

/* Player Badge Styles */
.player-badges-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(184, 134, 11, 0.05);
    border: 1px solid rgba(184, 134, 11, 0.2);
    border-radius: 12px;
    overflow: visible;
}

.player-badges-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.player-badges-title {
    font-size: 18px;
    font-weight: 500;
    color: rgba(184, 134, 11, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge-ranking {
    font-size: 14px;
    color: rgba(184, 134, 11, 0.8);
    font-weight: 400;
    padding: 2px 8px;
    background: rgba(184, 134, 11, 0.1);
    border-radius: 12px;
}

.player-badges-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge-sparkline-container {
    margin-top: 1rem;
    width: 100%;
    height: 60px;
    position: relative;
    overflow: visible;
}

/* Compact Insights Row */
.insights-compact-row {
    display: flex;
    gap: 8px;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(184, 134, 11, 0.4) rgba(0, 0, 0, 0.2);
}

.insights-compact-row::-webkit-scrollbar {
    height: 6px;
}

.insights-compact-row::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.insights-compact-row::-webkit-scrollbar-thumb {
    background: rgba(184, 134, 11, 0.4);
    border-radius: 3px;
}

.insight-card-compact {
    flex: 0 0 auto;
    min-width: 120px;
    max-width: 140px;
    background: rgba(184, 134, 11, 0.08);
    border: 1px solid rgba(184, 134, 11, 0.2);
    border-radius: 8px;
    padding: 8px 10px;
    transition: all 0.2s ease;
}

.insight-card-compact:hover {
    background: rgba(184, 134, 11, 0.12);
    border-color: rgba(184, 134, 11, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(184, 134, 11, 0.2);
}

.insight-card-compact-title {
    font-size: 11px;
    color: rgba(184, 134, 11, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 4px;
}

.insight-card-compact-value {
    font-size: 14px;
    color: #fff;
    font-weight: 700;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.insight-card-compact-description {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}

/* Commander Cards Display */
.commander-cards-section {
    margin-bottom: 1rem;
    padding: 1.5rem;
    background: rgba(184, 134, 11, 0.05);
    border: 1px solid rgba(184, 134, 11, 0.2);
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: thin;
    scrollbar-color: rgba(184, 134, 11, 0.4) rgba(0, 0, 0, 0.2);
}

/* Webkit scrollbar styling for commander cards */
.commander-cards-section::-webkit-scrollbar {
    height: 8px;
}

.commander-cards-section::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.commander-cards-section::-webkit-scrollbar-thumb {
    background: rgba(184, 134, 11, 0.4);
    border-radius: 4px;
    transition: background 0.3s ease;
}

.commander-cards-section::-webkit-scrollbar-thumb:hover {
    background: rgba(184, 134, 11, 0.6);
}

.commander-cards-container {
    position: relative;
    height: 280px;
    min-width: 100%;
}

.commander-card {
    position: absolute;
    top: 0;
    width: 200px;
    height: 280px;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, z-index 0s 0s, box-shadow 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.commander-card:hover {
    transform: translateY(-20px) scale(1.05);
    z-index: 1000 !important;
    box-shadow: 0 12px 24px rgba(184, 134, 11, 0.4), 0 0 20px rgba(184, 134, 11, 0.2);
    transition: transform 0.3s ease, z-index 0s 0s, box-shadow 0.3s ease;
}

.commander-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 12px;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .commander-card {
        width: 150px;
        height: 210px;
    }
    
    .commander-cards-container {
        height: 210px;
    }
}

/* First to Die Chart Container (for Eliminations page) */
.first-to-die-chart-container {
    height: 350px;
    position: relative;
}

/* Badge Trend Modal */
.badge-trend-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.badge-trend-modal.active {
    display: flex;
}

.badge-trend-modal-content {
    background: rgba(30, 30, 60, 0.95);
    border: 2px solid rgba(184, 134, 11, 0.3);
    border-radius: 16px;
    padding: 2rem;
    max-width: 900px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.badge-trend-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.badge-trend-modal-title {
    font-size: 24px;
    font-weight: 600;
    color: rgba(211, 211, 211, 1);
}

.badge-trend-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: rgba(211, 211, 211, 0.6);
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.badge-trend-modal-close:hover {
    color: rgba(211, 211, 211, 1);
}

.badge-trend-modal-chart {
    height: 400px;
    position: relative;
}

/* Badge Details Modal */
.badge-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.badge-modal-content {
    background: linear-gradient(135deg, rgba(30, 30, 60, 0.98) 0%, rgba(20, 20, 40, 0.98) 100%);
    border: 2px solid rgba(184, 134, 11, 0.3);
    border-radius: 16px;
    padding: 2rem;
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 60px rgba(184, 134, 11, 0.1);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.badge-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(184, 134, 11, 0.2);
}

.badge-modal-title {
    font-size: 24px;
    font-weight: 600;
    color: rgba(184, 134, 11, 1);
    text-shadow: 0 0 20px rgba(184, 134, 11, 0.3);
}

.badge-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: rgba(211, 211, 211, 0.6);
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 8px;
}

.badge-modal-close:hover {
    color: rgba(211, 211, 211, 1);
    background: rgba(255, 255, 255, 0.05);
}

.badge-modal-description {
    color: rgba(211, 211, 211, 0.9);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(184, 134, 11, 0.05);
    border-left: 3px solid rgba(184, 134, 11, 0.5);
    border-radius: 4px;
}

.badge-modal-current-holder {
    margin-bottom: 2rem;
    text-align: center;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(184, 134, 11, 0.2);
}

.current-holder-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(184, 134, 11, 0.8);
    margin-bottom: 0.5rem;
}

.current-holder-name {
    font-size: 28px;
    font-weight: 700;
    text-shadow: 0 0 20px currentColor;
}

.badge-modal-timeline h4 {
    color: rgba(184, 134, 11, 1);
    font-size: 18px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.badge-timeline-container {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.badge-timeline-container::-webkit-scrollbar {
    width: 6px;
}

.badge-timeline-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.badge-timeline-container::-webkit-scrollbar-thumb {
    background: rgba(184, 134, 11, 0.4);
    border-radius: 3px;
}

.badge-timeline-container::-webkit-scrollbar-thumb:hover {
    background: rgba(184, 134, 11, 0.6);
}

.badge-timeline-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 80px 1fr 60px;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.timeline-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(184, 134, 11, 0.3);
}

.timeline-item.milestone {
    background: rgba(184, 134, 11, 0.08);
    border-color: rgba(184, 134, 11, 0.3);
}

.timeline-game {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

.timeline-transfer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.timeline-from,
.timeline-to {
    font-weight: 600;
}

.timeline-arrow {
    color: rgba(255, 255, 255, 0.3);
}

.timeline-count {
    text-align: right;
    font-size: 13px;
    color: rgba(184, 134, 11, 1);
    font-weight: 600;
}

.timeline-truncated {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    font-style: italic;
    padding: 12px;
    margin-top: 8px;
}

.timeline-stats {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(184, 134, 11, 0.2);
    font-size: 13px;
    color: rgba(184, 134, 11, 0.8);
}

.timeline-stats span {
    font-weight: 500;
}

.no-timeline,
.error {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    padding: 2rem;
    font-style: italic;
}

.player-badge {
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.player-badge.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.player-badge.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.4);
}

.badge-label-with-helper {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge-helper-text {
    font-size: 10px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    letter-spacing: 0.2px;
}

.player-badge.exclusive {
    box-shadow: 0 0 8px rgba(184, 134, 11, 0.3);
}

.player-badge.sol-ring-leader {
    background: rgba(192, 192, 192, 0.2);
    color: rgba(211, 211, 211, 1);
    border: 1px solid rgba(192, 192, 192, 0.4);
}

.player-badge.combat-leader {
    background: rgba(220, 20, 60, 0.2);
    color: rgba(255, 99, 71, 1);
    border: 1px solid rgba(220, 20, 60, 0.4);
}

.player-badge.direct-damage-leader {
    background: rgba(255, 140, 0, 0.2);
    color: rgba(255, 165, 0, 1);
    border: 1px solid rgba(255, 140, 0, 0.4);
}

.player-badge.unique-methods-leader {
    background: rgba(138, 43, 226, 0.2);
    color: rgba(138, 43, 226, 1);
    border: 1px solid rgba(138, 43, 226, 0.4);
}

.player-badge.infect-leader {
    background: rgba(0, 128, 0, 0.2);
    color: rgba(50, 205, 50, 1);
    border: 1px solid rgba(0, 128, 0, 0.4);
}

.player-badge.win-streak-leader {
    background: rgba(255, 215, 0, 0.2);
    color: rgba(255, 215, 0, 1);
    border: 1px solid rgba(255, 215, 0, 0.4);
}

.player-badge.first-to-die-leader {
    background: rgba(139, 69, 19, 0.2);
    color: rgba(210, 105, 30, 1);
    border: 1px solid rgba(139, 69, 19, 0.4);
}

.player-badge.second-place-leader {
    background: rgba(192, 192, 192, 0.2);
    color: rgba(211, 211, 211, 1);
    border: 1px solid rgba(192, 192, 192, 0.4);
    cursor: pointer;
    transition: all 0.2s ease;
}

.player-badge.second-place-leader:hover {
    background: rgba(192, 192, 192, 0.3);
    box-shadow: 0 0 12px rgba(192, 192, 192, 0.4);
}

.player-badge.hot-streak {
    background: rgba(255, 215, 0, 0.2);
    color: rgba(255, 215, 0, 1);
    border: 1px solid rgba(255, 215, 0, 0.4);
}

.player-badge.year-dominator {
    background: rgba(184, 134, 11, 0.2);
    color: rgba(184, 134, 11, 1);
    border: 1px solid rgba(184, 134, 11, 0.4);
}

.player-badge.voltron-master {
    background: rgba(138, 43, 226, 0.2);
    color: rgba(186, 85, 211, 1);
    border: 1px solid rgba(138, 43, 226, 0.4);
}

.player-badge.voltron-specialist {
    background: rgba(138, 43, 226, 0.2);
    color: rgba(186, 85, 211, 1);
    border: 1px solid rgba(138, 43, 226, 0.4);
}

.player-badge.unique-methods-recent {
    background: rgba(255, 105, 180, 0.2);
    color: rgba(255, 182, 193, 1);
    border: 1px solid rgba(255, 105, 180, 0.4);
}

.player-badge.tenth-elimination {
    background: rgba(255, 215, 0, 0.2);
    color: rgba(255, 215, 0, 1);
    border: 1px solid rgba(255, 215, 0, 0.4);
}

.player-badge.new-elimination {
    background: rgba(255, 69, 0, 0.2);
    color: rgba(255, 140, 0, 1);
    border: 1px solid rgba(255, 69, 0, 0.4);
}

.player-badge.signature-method {
    background: rgba(70, 130, 180, 0.2);
    color: rgba(135, 206, 250, 1);
    border: 1px solid rgba(70, 130, 180, 0.4);
}

.player-badge.archetype {
    background: rgba(147, 112, 219, 0.2);
    color: rgba(186, 85, 211, 1);
    border: 1px solid rgba(147, 112, 219, 0.4);
}

.badge-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
}

.elimination-info {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

.insights-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.insight-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.insight-badge.first-commander {
    background: rgba(138, 43, 226, 0.2);
    color: rgba(138, 43, 226, 1);
    border: 1px solid rgba(138, 43, 226, 0.4);
}

.insight-badge.first-elimination {
    background: rgba(255, 69, 0, 0.2);
    color: rgba(255, 140, 0, 1);
    border: 1px solid rgba(255, 69, 0, 0.4);
}

.insight-badge.win-number {
    background: rgba(184, 134, 11, 0.2);
    color: rgba(184, 134, 11, 1);
    border: 1px solid rgba(184, 134, 11, 0.4);
}

.loading {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 40px;
    font-size: 14px;
}

.loading.hidden {
    display: none;
}

/* Game Wrapper with Commander Images */
.game-wrapper {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.game-card {
    flex: 1;
    min-width: 0;
    max-width: 100%; /* Allow full width for sankey diagram */
}

.commander-images {
    position: relative;
    flex-shrink: 0;
    width: 180px;
    min-height: 250px; /* Ensure space for stacked cards */
    transition: all 0.3s ease;
}

.commander-img-wrapper,
.elimination-card-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 180px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(26, 26, 26, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 1;
}

/* All cards get z-index but dynamic translateY from JS */
.commander-img-wrapper:nth-child(1),
.elimination-card-wrapper:nth-child(1) { z-index: 1; }

.commander-img-wrapper:nth-child(2),
.elimination-card-wrapper:nth-child(2) { z-index: 2; }

.commander-img-wrapper:nth-child(3),
.elimination-card-wrapper:nth-child(3) { z-index: 3; }

.commander-img-wrapper:nth-child(4),
.elimination-card-wrapper:nth-child(4) { z-index: 4; }

.commander-img-wrapper:nth-child(5),
.elimination-card-wrapper:nth-child(5) { z-index: 5; }

.commander-img-wrapper:nth-child(6),
.elimination-card-wrapper:nth-child(6) { z-index: 6; }

.commander-img-wrapper:nth-child(7),
.elimination-card-wrapper:nth-child(7) { z-index: 7; }

.commander-img-wrapper:nth-child(8),
.elimination-card-wrapper:nth-child(8) { z-index: 8; }

.commander-img-wrapper:nth-child(9),
.elimination-card-wrapper:nth-child(9) { z-index: 9; }

.commander-img-wrapper:nth-child(10),
.elimination-card-wrapper:nth-child(10) { z-index: 10; }

/* Individual card lift on hover - like card fan behavior */
/* Triggered by JS when mouse is in top 25% of card */
.commander-img-wrapper.card-hover-active,
.elimination-card-wrapper.card-hover-active {
    transform: translateY(calc(var(--stack-offset, 0px) - 40px)) scale(1.15) !important;
    z-index: 999 !important;
    box-shadow: 
        0 0 30px rgba(138, 43, 226, 0.6),
        0 8px 32px rgba(0, 0, 0, 0.6),
        0 0 60px rgba(138, 43, 226, 0.3);
    filter: brightness(1.1);
    border-color: rgba(138, 43, 226, 0.6);
}

/* CSS custom properties for stack offsets are now set dynamically in JS */

.commander-img-wrapper img,
.elimination-card-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

.img-loading {
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 12px;
}

/* Badge Transfer Section */
.badge-transfer-section {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(184, 134, 11, 0.08);
    border: 1px solid rgba(184, 134, 11, 0.25);
    border-radius: 12px;
}

.badge-transfer-title {
    font-size: 14px;
    font-weight: 600;
    color: rgba(184, 134, 11, 1);
    margin-bottom: 0.75rem;
}

.badge-transfers {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.badge-transfer {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem;
    background: rgba(184, 134, 11, 0.05);
    border-radius: 8px;
}

.badge-transfer-label {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 215, 0, 1);
}

.badge-transfer-flow {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 13px;
}

.badge-transfer-from {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: line-through;
}

.badge-transfer-arrow {
    color: rgba(184, 134, 11, 1);
    font-weight: bold;
}

.badge-transfer-to {
    color: rgba(255, 215, 0, 1);
    font-weight: 600;
}

.badge-transfer-count {
    margin-left: auto;
    padding: 2px 8px;
    background: rgba(255, 215, 0, 0.2);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 215, 0, 1);
}

.badge-achievement {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(138, 43, 226, 0.08);
    border-radius: 8px;
    font-size: 13px;
}

.badge-achievement-icon {
    font-size: 16px;
}

.badge-achievement-player {
    font-weight: 600;
    color: rgba(138, 43, 226, 1);
}

.badge-achievement-label {
    color: rgba(255, 255, 255, 0.8);
}

.badge-achievement-detail {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    font-style: italic;
}

.badge-signature-change {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(70, 130, 180, 0.08);
    border-radius: 8px;
    font-size: 13px;
}

.badge-signature-icon {
    font-size: 16px;
}

.badge-signature-player {
    font-weight: 600;
    color: rgba(135, 206, 250, 1);
}

.badge-signature-label {
    color: rgba(255, 255, 255, 0.8);
}

.badge-signature-count {
    padding: 2px 6px;
    background: rgba(135, 206, 250, 0.2);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(135, 206, 250, 1);
}

.badge-signature-previous {
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    font-style: italic;
}

.badge-tie {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(147, 112, 219, 0.08);
    border-radius: 8px;
    font-size: 13px;
}

.badge-tie-icon {
    font-size: 16px;
}

.badge-tie-players {
    font-weight: 600;
    color: rgba(186, 85, 211, 1);
}

.badge-tie-label {
    color: rgba(255, 255, 255, 0.8);
}

.badge-tie-count {
    padding: 2px 6px;
    background: rgba(186, 85, 211, 0.2);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(186, 85, 211, 1);
}

/* Responsive: Move commander images below on small screens */
@media (max-width: 900px) {
    .game-wrapper {
        flex-direction: column;
        margin-left: 0; /* Reset left margin on mobile */
    }
    
    .commander-images {
        position: static;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
        justify-content: center;
        min-height: auto;
        gap: 12px;
    }
    
    .commander-img-wrapper,
    .elimination-card-wrapper {
        position: static;
        width: 140px;
        transform: none !important;
    }
    
    .commander-images:hover .commander-img-wrapper,
    .commander-images:hover .elimination-card-wrapper {
        transform: none !important;
    }
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(26, 26, 26, 0.8);
    border: 1px solid rgba(184, 134, 11, 0.3);
    color: rgba(184, 134, 11, 0.8);
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: rgba(184, 134, 11, 0.2);
    border-color: rgba(184, 134, 11, 0.6);
    transform: translateY(-2px);
}

/* AI Summary */
.ai-summary {
    background: rgba(26, 26, 26, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(184, 134, 11, 0.3);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}

.summary-loading {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    font-style: italic;
}

.summary-content {
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    line-height: 1.6;
}

.ai-summary.hidden {
    display: none;
}

.ai-sparkle {
    font-size: 16px;
    margin-right: 4px;
}

/* Load More Button */
.load-more-btn {
    display: block;
    margin: 32px auto;
    padding: 12px 32px;
    background: rgba(26, 26, 26, 0.8);
    border: 1px solid rgba(184, 134, 11, 0.4);
    border-radius: 24px;
    color: rgba(184, 134, 11, 0.9);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.load-more-btn:hover:not(:disabled) {
    background: rgba(184, 134, 11, 0.2);
    border-color: rgba(184, 134, 11, 0.6);
    transform: translateY(-1px);
}

.load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Commander Tooltip */
.commander-tooltip {
    position: fixed;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid rgba(184, 134, 11, 0.6);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

.commander-tooltip img {
    display: block;
    width: 244px;
    height: auto;
    border-radius: 8px;
}

.tooltip-loading {
    color: rgba(255, 255, 255, 0.6);
    padding: 12px 24px;
    font-size: 12px;
}

/* Elimination Milestone Badge */
.insight-badge.elimination-milestone {
    background: rgba(255, 215, 0, 0.2);
    color: rgba(255, 215, 0, 1);
    border: 1px solid rgba(255, 215, 0, 0.4);
}

/* First Blood Badge */
.insight-badge.first-blood {
    background: rgba(220, 20, 60, 0.2);
    color: rgba(255, 69, 58, 1);
    border: 1px solid rgba(220, 20, 60, 0.4);
}

/* Make position numbers hoverable */
.finish-position {
    cursor: help;
    transition: transform 0.2s ease;
}

.finish-position:hover {
    transform: scale(1.1);
}

/* Expected Winner Badges */
.game-badge.expected-winner-correct {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.4);
}

.game-badge.expected-winner-wrong {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
    border: 1px solid rgba(255, 152, 0, 0.4);
}

/* ========================================
   MOBILE RESPONSIVE STYLES FOR GAMES FEED
   ======================================== */

/* Tablet and below (768px) */
@media (max-width: 768px) {
    /* Game cards */
    .game-card {
        margin-bottom: 1.5rem;
    }
    
    /* Game header */
    .game-header {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .game-info {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    /* Stacked cards */
    .stacked-cards {
        max-width: 100%;
    }
    
    /* Commander cards in game */
    .commander-entry {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .commander-info {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .commander-cards-wrapper {
        width: 100%;
    }
    
    /* Elimination cards */
    .elimination-card {
        max-width: 100%;
    }
    
    /* Sankey diagram */
    .sankey-container {
        overflow-x: auto;
    }
    
    /* Color circles */
    .color-circles {
        flex-wrap: wrap;
    }
    
    /* Game badges */
    .game-badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .pagination button {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Mobile phones (480px) */
@media (max-width: 480px) {
    /* Compact game cards */
    .game-card {
        padding: 1rem;
    }
    
    .game-number {
        font-size: 1.1rem;
    }
    
    .game-date {
        font-size: 0.75rem;
    }
    
    /* Smaller stacked cards */
    .stacked-cards {
        transform: scale(0.85);
        transform-origin: left center;
    }
    
    /* Commander name */
    .commander-name {
        font-size: 0.95rem;
    }
    
    /* Finish position badge */
    .finish-position {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }
    
    /* Summary text */
    .game-summary {
        font-size: 0.85rem;
        padding: 0.75rem;
    }
    
    /* Insights */
    .insight-badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Pagination */
    .pagination button {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
    
    .pagination span {
        font-size: 0.85rem;
    }
}

/* Small mobile (380px) */
@media (max-width: 380px) {
    .game-card {
        padding: 0.75rem;
    }
    
    .stacked-cards {
        transform: scale(0.7);
    }
    
    .game-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
    
    .commander-name {
        font-size: 0.9rem;
    }
}

/* Clickable Commander Cards */
.clickable-commander {
    cursor: pointer;
    transition: all 0.3s ease;
}

.clickable-commander:hover {
    transform: translateY(-5px) scale(1.02);
    filter: brightness(1.1);
    z-index: 999 !important;
}

.clickable-commander img {
    pointer-events: none;
}

/* Deck Modal Styles */
.deck-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.deck-modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(138, 43, 226, 0.4);
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.deck-modal-header {
    display: flex;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.deck-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.deck-modal-close:hover {
    color: #f5576c;
    background: rgba(245, 87, 108, 0.1);
    transform: rotate(90deg);
}

.deck-modal-body {
    padding: 1.5rem;
}

.deck-modal-body .loading,
.deck-modal-body .error {
    text-align: center;
    padding: 40px;
    color: #888;
}

/* Deck rank item styles (reuse from sync-styles.css) */
.deck-modal-body .deck-rank-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
}

.deck-modal-body .deck-rank-card-image {
    flex-shrink: 0;
    width: 120px;
    height: 167px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    position: relative;
}

.deck-modal-body .deck-rank-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.deck-modal-body .deck-owner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.9) 100%);
    color: #fff;
    padding: 8px 6px 6px 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    border-radius: 0 0 8px 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.deck-modal-body .deck-rank-info {
    flex: 1;
}

.deck-modal-body .deck-rank-name {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.deck-modal-body .deck-rank-name strong {
    font-size: 1.1rem;
    color: #f5576c;
}

.deck-modal-body .deck-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.deck-modal-body .deck-rank-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.deck-modal-body .stat-pill {
    padding: 0.35rem 0.75rem;
    background: rgba(138, 43, 226, 0.2);
    border-radius: 20px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
}

.deck-modal-body .deck-link {
    padding: 0.5rem 1.25rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
}

.deck-modal-body .deck-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.deck-modal-body .mana-curve-mini {
    display: flex;
    gap: 4px;
    align-items: flex-end;
    height: 60px;
    margin-top: 0.75rem;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.deck-modal-body .curve-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    position: relative;
}

.deck-modal-body .curve-fill {
    width: 100%;
    background: linear-gradient(180deg, rgba(138, 43, 226, 0.8) 0%, rgba(245, 87, 108, 0.6) 100%);
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: height 0.3s ease;
}

.deck-modal-body .curve-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

@media (max-width: 768px) {
    .deck-modal-body .deck-rank-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .deck-modal-body .deck-rank-card-image {
        width: 100px;
        height: 139px;
    }
}
