/* Edge AI Track Record Page - Enhanced UI/UX Design */
/* Following UI/UX Guidelines: Ma (space), Wa (harmony), Calm Technology */

/* ============================================
   COMPACT HEADER BAR - All-in-one navigation
   ============================================ */
.track-record-header {
    background: #FFFFFF;
    border-bottom: 1px solid #DEE2E6;
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0 1rem;
}

/* Header Title */
.header-title h1 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.title-brand {
    color: #212529;
}

.title-divider {
    color: #DEE2E6;
    font-weight: 300;
}

.title-page {
    color: #10B981;
    font-weight: 700;
}

/* Header Filters - Center section */
.header-filters {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Compact Select Dropdowns */
.filter-select-compact {
    background: #F8F9FA;
    border: 1px solid #DEE2E6;
    color: #212529;
    border-radius: 6px;
    padding: 0.375rem 1.75rem 0.375rem 0.625rem;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%236C757D' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 10px;
    min-width: 70px;
}

.filter-select-compact:hover {
    border-color: #10B981;
    background-color: #FFFFFF;
}

.filter-select-compact:focus {
    outline: none;
    border-color: #10B981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

/* Filter Pills (segmented control) */
.filter-pills {
    display: inline-flex;
    background: #F8F9FA;
    border-radius: 6px;
    padding: 0.125rem;
    gap: 0.125rem;
}

.filter-pill {
    position: relative;
    cursor: pointer;
    margin: 0;
}

.filter-pill input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.filter-pill span {
    display: inline-block;
    padding: 0.3125rem 0.625rem;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6C757D;
    background: transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.filter-pill:hover span {
    color: #212529;
}

.filter-pill input[type="radio"]:checked + span {
    background: #FFFFFF;
    color: #10B981;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* Compact Update Button */
.btn-update-compact {
    background: #10B981;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-update-compact:hover {
    background: #0B956C;
    transform: scale(1.05);
}

.btn-update-compact.btn-warning {
    background: #fbbf24;
    color: #000;
    animation: pulse-compact 1.5s infinite;
}

@keyframes pulse-compact {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Compact Reset Button */
.btn-reset-compact {
    background: transparent;
    color: #6C757D;
    border: 1px solid #DEE2E6;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-reset-compact:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

/* Header CTA Button */
.header-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #10B981;
    color: #FFFFFF;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.header-cta:hover {
    background: #0B956C;
    color: #FFFFFF;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.header-cta i {
    font-size: 0.8125rem;
}

/* Filter Status Bar */
.filter-status-bar {
    background: #fef3c7;
    color: #92400e;
    padding: 0.375rem 1rem;
    margin-top: 0.5rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================
   LEGACY HERO SECTION (kept for backward compat)
   ============================================ */
.track-record-hero {
    background: linear-gradient(135deg, #F8F9FA 0%, #FFFFFF 100%);
    position: relative;
    overflow: hidden;
    padding: 4rem 0;
}

.track-record-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.03) 0%, transparent 70%);
    pointer-events: none;
}

/* Hero Title - Matches homepage styling */
.hero-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.hero-title-main {
    display: block;
}

.hero-title-secondary {
    display: block;
    color: var(--cta-primary);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 500;
    opacity: 0.9;
}

/* Trust Metrics Grid - Prominent Display with Ma (Space) */
.trust-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Trust Metric Cards - Wa (Harmony) with Consistent Styling */
.trust-metric-card {
    background: #FFFFFF;
    border: 1px solid #DEE2E6;
    border-radius: 16px;
    padding: 2.5rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.trust-metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #10B981 0%, #0B956C 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.trust-metric-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    border-color: #10B981;
}

.trust-metric-card:hover::before {
    transform: scaleX(1);
}

/* Trust Metric Icon */
.trust-metric-icon {
    width: 56px;
    height: 56px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: #10B981;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.trust-metric-card:hover .trust-metric-icon {
    background: #10B981;
    color: #FFFFFF;
    transform: scale(1.1) rotate(5deg);
}

/* Trust Metric Value */
.trust-metric-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: #212529;
    line-height: 1;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

/* Trust Metric Label */
.trust-metric-label {
    font-size: 0.875rem;
    color: #6C757D;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Hero CTA Button */
.hero-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #10B981;
    color: #FFFFFF;
    padding: 1rem 2.5rem;
    border-radius: 12px;
    font-size: 1.125rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    letter-spacing: 0.02em;
}

.hero-cta-button:hover {
    background: #0B956C;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
    color: #FFFFFF;
}

.hero-cta-button:active {
    transform: translateY(0);
}

/* Logo Styling (kept for backward compatibility) */
.hero-logo-wrapper {
    display: inline-block;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-logo-wrapper:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

/* Enhanced Filter Bar - Horizontal Layout */
.filter-bar {
    background: #FFFFFF;
    border: 1px solid #DEE2E6;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-bar:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.filter-icon {
    color: #6C757D;
    font-size: 1.125rem;
    transition: color 0.2s ease;
}

.filter-group:hover .filter-icon {
    color: #10B981;
}

.filter-select {
    background: #F8F9FA;
    border: 1px solid #DEE2E6;
    color: #212529;
    border-radius: 8px;
    padding: 0.625rem 2.5rem 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236C757D' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
}

.filter-select:hover {
    border-color: #10B981;
    background-color: #FFFFFF;
}

.filter-select:focus {
    outline: none;
    border-color: #10B981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    background-color: #FFFFFF;
}

/* Radio Button Groups (styled like segmented controls) */
.radio-group {
    display: inline-flex;
    background: #F8F9FA;
    border-radius: 8px;
    padding: 0.25rem;
    gap: 0.25rem;
}

.radio-option {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-option span {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6C757D;
    background: transparent;
    transition: all 0.2s ease;
}

.radio-option:hover span {
    color: #212529;
}

.radio-option input[type="radio"]:checked + span {
    background: #FFFFFF;
    color: #10B981;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Segmented Control for Season Type (keeping for backward compatibility) */
.segmented-control {
    display: inline-flex;
    background: #F8F9FA;
    border-radius: 8px;
    padding: 0.25rem;
    gap: 0.25rem;
}

.segment-option {
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6C757D;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.segment-option:hover {
    color: #212529;
}

.segment-option.active {
    background: #FFFFFF;
    color: #10B981;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Filter Actions */
.filter-actions {
    margin-left: auto;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-update {
    background: #10B981;
    color: white;
    border: none;
    padding: 0.625rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-update:hover {
    background: #0B956C;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.2);
}

/* Warning state when filters are changed */
.btn-update.btn-warning {
    background: #fbbf24;
    color: #000;
    animation: pulse 1.5s infinite;
}

.btn-update.btn-warning:hover {
    background: #f59e0b;
    animation: none;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Reset button */
.btn-reset {
    background: transparent;
    color: #6C757D;
    border: 1px solid #DEE2E6;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-reset:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.btn-export {
    background: transparent;
    color: #6C757D;
    border: 1px solid #DEE2E6;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-export:hover {
    color: #10B981;
    border-color: #10B981;
    background: rgba(16, 185, 129, 0.05);
}

/* Performance Metrics - Enhanced Cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.metric-card {
    background: #FFFFFF;
    border: 1px solid #DEE2E6;
    border-radius: 16px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #10B981 0%, #0B956C 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.metric-card:hover::before {
    opacity: 1;
}

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

.metric-title {
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.metric-icon {
    width: 40px;
    height: 40px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #10B981;
    font-size: 1.25rem;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #212529;
    line-height: 1;
    margin-bottom: 0.5rem;
    transition: transform 0.3s ease;
}

.metric-value:hover {
    transform: scale(1.05);
}

.metric-label {
    font-size: 0.875rem;
    color: #6C757D;
    font-weight: 500;
}

.metric-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    margin-top: 1rem;
}

.trend-positive {
    color: #10B981;
    background: rgba(16, 185, 129, 0.1);
}

.trend-negative {
    color: #DC3545;
    background: rgba(220, 53, 69, 0.1);
}

/* Progress Bars - Smooth and Modern */
.metric-progress {
    margin-top: 1.5rem;
}

.progress {
    height: 8px;
    background: #F8F9FA;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    background: linear-gradient(90deg, #10B981 0%, #0B956C 100%);
    height: 100%;
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ============================================
   TEAM LOGO DISPLAY FIX
   Problem: Logos were too small and getting cut off
   Solution: Remove overflow:hidden, use proper sizing
   ============================================ */

/* Fix 1: Give team-info proper minimum width so logos aren't squeezed */
.winner-card .team-info,
.prediction-card .team-info {
    min-width: 100px;
    flex: 1 1 auto;
    overflow: visible; /* Allow logo to display fully */
}

/* Fix 2: Logo container sizing - no clipping */
.winner-card .team-logo-container,
.prediction-card .team-logo-container {
    width: 120px;
    height: 120px;
    overflow: visible; /* CRITICAL: Don't clip the logo */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Fix 3: Proper logo sizing with object-fit */
.winner-card .team-logo,
.prediction-card .team-logo {
    width: 110px;
    height: 110px;
    max-width: 110px;
    max-height: 110px;
    object-fit: contain;
    border-radius: 50%;
}

/* Fix 4: Responsive logo sizing */
@media (max-width: 1400px) {
    .winner-card .team-logo-container,
    .prediction-card .team-logo-container {
        width: 100px;
        height: 100px;
    }
    .winner-card .team-logo,
    .prediction-card .team-logo {
        width: 90px;
        height: 90px;
        max-width: 90px;
        max-height: 90px;
    }
}

@media (max-width: 992px) {
    .winner-card .team-logo-container,
    .prediction-card .team-logo-container {
        width: 90px;
        height: 90px;
    }
    .winner-card .team-logo,
    .prediction-card .team-logo {
        width: 80px;
        height: 80px;
        max-width: 80px;
        max-height: 80px;
    }
}

/* Fix 5: Minimum card width to fit logos + team names */
.winner-card, .loss-card, .push-card {
    min-width: 340px;
}

/* Override min-width for larger column layouts (4-col at 1400px, 5-col at 1800px) */
@media (min-width: 1400px) {
    .winner-card, .loss-card, .push-card {
        min-width: 0;
    }
}

/* Responsive logo sizing for 4-column layout - bigger logos, closer together */
@media (min-width: 1400px) {
    /* Tighter card padding */
    .winner-card, .loss-card, .push-card {
        padding: 1rem 0.5rem;
    }

    /* Bigger logos */
    .winner-card .team-logo-container,
    .prediction-card .team-logo-container {
        width: 90px;
        height: 90px;
    }

    .winner-card .team-logo,
    .prediction-card .team-logo {
        width: 85px;
        height: 85px;
        max-width: 85px;
        max-height: 85px;
    }

    /* Pull teams closer together */
    .winner-card .team-matchup,
    .prediction-card .team-matchup {
        justify-content: center;
        gap: 0;
    }

    /* Use negative margins to slide teams closer */
    .winner-card .team-info:first-child,
    .prediction-card .team-info:first-child {
        margin-right: -10px;
    }

    .winner-card .team-info:last-child,
    .prediction-card .team-info:last-child {
        margin-left: -10px;
    }

    /* Narrower team info */
    .winner-card .team-info,
    .prediction-card .team-info {
        min-width: auto;
        flex: 0 0 auto;
    }

    /* Smaller team names */
    .winner-card .team-name,
    .prediction-card .team-name {
        max-width: 80px;
        font-size: 0.7rem;
        line-height: 1.15;
    }

    /* Hide vs indicator to save space */
    .vs-indicator {
        display: none;
    }

    /* Compact scores and badges */
    .final-score {
        font-size: 1rem;
    }

    .team-location {
        font-size: 0.65rem;
    }

    .edge-ai-banner {
        font-size: 0.5rem !important;
        padding: 0.1rem 0.25rem !important;
    }
}

/* Fix 6: Team name - allow wrapping for long names */
.winner-card .team-name,
.prediction-card .team-name {
    max-width: 100px;
    font-size: 0.9rem;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal !important;  /* Force text to wrap - fixes long name overlap */
    hyphens: auto;
}

/* ============================================
   RESPONSIVENESS: More columns on large screens
   ============================================ */

.game-results-container .row > [class*="col-"] {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

@media (min-width: 1400px) {
    .game-results-container .col-lg-4 {
        flex: 0 0 auto;
        width: 25%; /* 4 columns */
    }
}

@media (min-width: 1800px) {
    .game-results-container .col-lg-4 {
        width: 20%; /* 5 columns */
    }
}

/* Extend content to edges */
.results-section {
    max-width: 100%;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Game Results Section */
.results-section {
    background: #FFFFFF;
    border: 1px solid #DEE2E6;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #DEE2E6;
}

.results-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.results-count {
    font-size: 0.875rem;
    color: #6C757D;
    font-weight: 500;
}

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, #F8F9FA 25%, #E9ECEF 50%, #F8F9FA 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    height: 200px;
    margin-bottom: 1rem;
}

/* ============================================
   MOBILE RESPONSIVE DESIGN
   Following UI/UX Style Guide: Ma (Space) & Wa (Harmony)
   ============================================ */

/* Medium screens (tablets) */
@media (max-width: 992px) {
    /* Matrix Stats - 3 columns on tablet */
    #matrix-stats-container {
        gap: 1rem !important;
    }

    #matrix-stats-container > div {
        flex: 0 0 calc(33.333% - 0.75rem);
        max-width: calc(33.333% - 0.75rem);
    }
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    /* ========================================
       GLOBAL MOBILE - Minimal edge margins
       ======================================== */
    .container,
    .container-fluid {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* ========================================
       HEADER - MOBILE OPTIMIZED
       ======================================== */
    .track-record-header {
        padding: 0.5rem 0;
        position: relative;
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }

    .header-bar {
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 0 0.5rem;
    }

    .header-title {
        order: 1;
        flex: 1 1 100%;
        text-align: center;
    }

    .header-title h1 {
        font-size: 1.125rem;
        justify-content: center;
        gap: 0.375rem;
    }

    .title-brand {
        display: none;
    }

    .title-divider {
        display: none;
    }

    .title-page {
        font-size: 1.25rem;
    }

    /* Filters - compact but touch-friendly */
    .header-filters {
        order: 2;
        flex: 1 1 100%;
        justify-content: center;
        gap: 0.5rem;
        flex-wrap: wrap;
        padding: 0.25rem 0;
    }

    .filter-select-compact {
        padding: 0.5rem 1.75rem 0.5rem 0.75rem;
        font-size: 0.875rem;
        min-width: 70px;
        min-height: 44px;
        border-radius: 8px;
    }

    .filter-pills {
        border-radius: 8px;
        padding: 0.125rem;
    }

    .filter-pill span {
        padding: 0.4375rem 0.75rem;
        font-size: 0.8125rem;
        min-height: 40px;
        display: flex;
        align-items: center;
    }

    .btn-update-compact,
    .btn-reset-compact {
        width: 40px;
        height: 40px;
        border-radius: 8px;
    }

    /* CTA Button */
    .header-cta {
        order: 3;
        flex: 1 1 100%;
        justify-content: center;
        padding: 0.75rem 1rem;
        font-size: 0.9375rem;
        border-radius: 10px;
        margin: 0.25rem 0.5rem 0;
    }

    .filter-status-bar {
        margin: 0.5rem 0.5rem 0;
        border-radius: 8px;
    }

    /* ========================================
       MATRIX STATS SECTION - Edge-to-edge
       ======================================== */
    #matrixStatsSection {
        padding: 1rem 0 !important;
        margin: 0 -0.5rem 1rem !important;
    }

    #matrix-stats-container {
        gap: 0.5rem !important;
        padding: 0 0.5rem;
    }

    #matrix-stats-container > div {
        flex: 0 0 calc(50% - 0.25rem);
        max-width: calc(50% - 0.25rem);
        padding: 0 !important;
    }

    .stat-card {
        padding: 1rem 0.75rem !important;
        min-height: 130px;
        border-radius: 10px !important;
    }

    .stat-card .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .stat-card .glitch-number {
        font-size: 1.375rem !important;
        margin-bottom: 0.25rem;
    }

    .stat-card .stat-label {
        font-size: 0.625rem;
        letter-spacing: 0.02em;
    }

    .tier-badge {
        font-size: 0.5rem;
        padding: 0.125rem 0.375rem;
        margin-bottom: 0.25rem;
    }

    .stat-card small {
        font-size: 0.625rem !important;
    }

    /* ========================================
       INFOGRAPHIC/METHODOLOGY - Edge-to-edge
       ======================================== */
    .methodology-section {
        margin: 0 -0.5rem 1rem !important;
        border-radius: 0 !important;
    }

    .methodology-card {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .infographic-container {
        padding: 0.75rem !important;
    }

    .infographic-container > div {
        border-radius: 8px !important;
    }

    /* ========================================
       RESULTS SECTION - MOBILE
       Edge-to-edge cards, minimal whitespace
       ======================================== */
    .results-section {
        padding: 0.75rem 0;
        margin-bottom: 1.5rem;
        border-radius: 0;
        margin-left: -1rem;
        margin-right: -1rem;
    }

    .results-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        margin-bottom: 1rem;
        padding: 0 1rem 0.75rem;
    }

    .results-title {
        font-size: 1.25rem;
    }

    .results-count {
        font-size: 0.875rem;
    }

    /* Game cards - EDGE-TO-EDGE on mobile */
    .content-chunk {
        padding: 0;
    }

    .content-chunk .row {
        margin: 0;
        gap: 0.75rem 0;
        padding: 0 0.5rem;
    }

    .content-chunk .row > [class*="col-"] {
        padding: 0;
    }

    /* Winner cards fill available width */
    .winner-card,
    .prediction-card,
    .game-card {
        margin: 0;
        width: 100%;
        border-radius: 12px;
    }

    /* ========================================
       LEGACY HERO SECTION (backward compat)
       ======================================== */
    .track-record-hero {
        padding: 2rem 0;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .trust-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 0;
    }

    .trust-metric-card {
        padding: 1.5rem 1rem;
    }

    .trust-metric-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    .trust-metric-value {
        font-size: 1.75rem;
    }

    .trust-metric-label {
        font-size: 0.75rem;
    }

    .hero-cta-button {
        padding: 0.875rem 2rem;
        font-size: 1rem;
        width: 100%;
        max-width: 300px;
    }

    /* ========================================
       FILTER BAR - LEGACY SUPPORT
       ======================================== */
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .filter-group {
        width: 100%;
    }

    .filter-select {
        width: 100%;
        min-height: 44px;
    }

    .filter-actions {
        margin-left: 0;
        margin-top: 1rem;
        width: 100%;
        flex-direction: column;
    }

    .btn-update,
    .btn-export {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    /* ========================================
       METRICS CARDS - LEGACY SUPPORT
       ======================================== */
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .metric-value {
        font-size: 2rem;
    }
}

/* ============================================
   SMALL MOBILE (< 414px)
   Tighter margins, edge-to-edge content
   ============================================ */
@media (max-width: 414px) {
    /* Global - even tighter */
    .container,
    .container-fluid {
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }

    /* Header - tighter */
    .track-record-header {
        margin-left: -0.25rem;
        margin-right: -0.25rem;
    }

    .header-bar {
        gap: 0.5rem;
        padding: 0 0.25rem;
    }

    .header-title h1 {
        font-size: 1rem;
    }

    .title-page {
        font-size: 1.125rem;
    }

    .header-filters {
        gap: 0.375rem;
    }

    .filter-select-compact {
        padding: 0.4375rem 1.5rem 0.4375rem 0.625rem;
        font-size: 0.8125rem;
        min-width: 65px;
    }

    .filter-pill span {
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
    }

    .header-cta {
        margin: 0.25rem 0.25rem 0;
        padding: 0.625rem 0.75rem;
        font-size: 0.875rem;
    }

    /* Stats section - tighter */
    #matrixStatsSection {
        margin: 0 -0.25rem 0.75rem !important;
        padding: 0.75rem 0 !important;
    }

    #matrix-stats-container {
        gap: 0.375rem !important;
        padding: 0 0.25rem;
    }

    #matrix-stats-container > div {
        flex: 0 0 calc(50% - 0.1875rem);
        max-width: calc(50% - 0.1875rem);
    }

    .stat-card {
        padding: 0.875rem 0.5rem !important;
        min-height: 120px;
        border-radius: 8px !important;
    }

    .stat-card .stat-icon {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
        margin-bottom: 0.375rem;
    }

    .stat-card .glitch-number {
        font-size: 1.25rem !important;
    }

    .stat-card .stat-label {
        font-size: 0.5625rem;
    }

    .tier-badge {
        font-size: 0.4375rem;
        padding: 0.0625rem 0.25rem;
    }

    /* Infographic - tighter */
    .methodology-section {
        margin: 0 -0.25rem 0.75rem !important;
    }

    .infographic-container {
        padding: 0.5rem !important;
    }

    /* Results - near edge-to-edge */
    .results-section {
        margin-left: -0.25rem;
        margin-right: -0.25rem;
        padding: 0.5rem 0;
    }

    .results-header {
        padding: 0 0.5rem 0.5rem;
        margin-bottom: 0.75rem;
    }

    .content-chunk .row {
        padding: 0 0.25rem;
        gap: 0.5rem 0;
    }
}

/* ============================================
   VERY SMALL SCREENS (< 380px)
   True edge-to-edge, minimal chrome
   ============================================ */
@media (max-width: 380px) {
    /* Near-zero container padding */
    .container,
    .container-fluid {
        padding-left: 0.125rem !important;
        padding-right: 0.125rem !important;
    }

    /* Header - ultra compact */
    .track-record-header {
        margin-left: -0.125rem;
        margin-right: -0.125rem;
        padding: 0.375rem 0;
    }

    .header-bar {
        padding: 0 0.125rem;
        gap: 0.375rem;
    }

    .header-filters {
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
    }

    .header-filters .filter-select-compact {
        width: 100%;
        max-width: 180px;
    }

    .header-filters .filter-pills {
        width: 100%;
        max-width: 180px;
        justify-content: center;
    }

    .header-cta {
        margin: 0.125rem 0.125rem 0;
    }

    /* Stats - true edge-to-edge */
    #matrixStatsSection {
        margin: 0 -0.125rem 0.5rem !important;
        padding: 0.5rem 0 !important;
    }

    #matrix-stats-container {
        gap: 0.25rem !important;
        padding: 0 0.125rem;
    }

    #matrix-stats-container > div {
        flex: 0 0 calc(50% - 0.125rem);
        max-width: calc(50% - 0.125rem);
    }

    .stat-card {
        padding: 0.75rem 0.375rem !important;
        min-height: 110px;
        border-radius: 6px !important;
    }

    .stat-card .stat-icon {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .stat-card .glitch-number {
        font-size: 1.125rem !important;
    }

    .stat-card .stat-label {
        font-size: 0.5rem;
    }

    /* Infographic - edge-to-edge */
    .methodology-section {
        margin: 0 -0.125rem 0.5rem !important;
    }

    .infographic-container {
        padding: 0.375rem !important;
    }

    /* Results - true edge-to-edge */
    .results-section {
        margin-left: -0.125rem;
        margin-right: -0.125rem;
        padding: 0.375rem 0;
    }

    .results-header {
        padding: 0 0.375rem 0.375rem;
        margin-bottom: 0.5rem;
    }

    .content-chunk .row {
        padding: 0 0.125rem;
        gap: 0.375rem 0;
    }

    .winner-card,
    .prediction-card {
        border-radius: 8px;
    }
}

/* Tablet responsive - hide title on smaller screens */
@media (max-width: 1024px) and (min-width: 769px) {
    .header-title h1 {
        font-size: 0.9375rem;
    }

    .title-brand {
        display: none;
    }

    .title-divider {
        display: none;
    }
}

/* ============================================
   LARGE SCREEN OPTIMIZATIONS (1200px+)
   Enhanced information density while maintaining Ma (space)
   ============================================ */

/* Large screens (1200px - 1399px) - 3 columns, compact cards */
@media (min-width: 1200px) {
    /* Compact card styling for large screens */
    .winner-card,
    .prediction-card,
    .game-card {
        min-height: 420px;
        padding: 1.25rem;
    }

    /* Slightly tighter team matchup section */
    .team-matchup-section {
        padding: 0.75rem 0;
    }

    /* Compact score display */
    .score-display-section {
        padding: 0.875rem;
        margin-top: 0.75rem;
    }

    .score-value {
        font-size: 2.25rem;
    }

    /* Tighter game info section */
    .game-info-section {
        padding-top: 0.75rem;
    }

    /* Results section optimizations */
    .results-section {
        padding: 1.5rem;
    }
}

/* Extra large screens (1400px - 1599px) - 4 columns, more compact */
@media (min-width: 1400px) {
    /* Content chunks use 4 columns */
    .content-chunk .row > [class*="col-lg-4"] {
        flex: 0 0 25%;
        max-width: 25%;
    }

    /* Even more compact cards */
    .winner-card,
    .prediction-card,
    .game-card {
        min-height: 380px;
        padding: 1rem;
    }

    /* Compact team display */
    .team-name-label {
        font-size: 0.9375rem;
        margin-top: 0.5rem;
    }

    /* Tighter spacing on matchup section */
    .team-matchup-section {
        padding: 0.5rem 0;
    }

    /* Smaller vs indicator */
    .vs-indicator {
        margin: 0 1rem;
        padding-top: 50px;
    }

    .vs-unified {
        font-size: 1rem;
    }

    /* Compact score display */
    .score-display-section {
        padding: 0.75rem;
        margin-top: 0.5rem;
    }

    .score-value {
        font-size: 2rem;
    }

    .score-dash {
        font-size: 1.5rem;
    }

    /* Compact badges */
    .edge-ai-pick-badge {
        font-size: 0.8rem;
        padding: 0.375rem 0.875rem;
    }

    /* Game info section */
    .game-info-section {
        padding-top: 0.5rem;
    }

    /* Matrix stats section - tighter on ultra-wide */
    #matrixStatsSection {
        padding: 1.5rem 0;
    }

    .stat-card {
        padding: 1.25rem 1rem;
    }

    /* Methodology section - tighter */
    .infographic-container {
        padding: 1rem;
    }
}

/* Ultra-wide screens (1600px+) - 4 columns with enhanced density */
@media (min-width: 1600px) {
    /* Maximum content width for ultra-wide */
    .container-fluid {
        max-width: 1800px;
        margin: 0 auto;
    }

    /* Even more compact cards for ultra-wide */
    .winner-card,
    .prediction-card,
    .game-card {
        min-height: 360px;
        padding: 0.875rem;
    }

    /* Compact team name */
    .team-name-label {
        font-size: 0.875rem;
        margin-top: 0.375rem;
    }

    /* Team logo - slightly smaller on ultra-wide to fit more content */
    .team-logo.team-logo-large {
        width: 90px;
        height: 90px;
    }

    /* Very compact score display */
    .score-display-section {
        padding: 0.625rem;
        margin-top: 0.375rem;
    }

    .score-value {
        font-size: 1.75rem;
        min-width: 50px;
    }

    .score-dash {
        font-size: 1.25rem;
        margin: 0 0.375rem;
    }

    .score-label {
        font-size: 0.6875rem;
        margin-top: 0.375rem;
    }

    /* Compact edge-ai pick section */
    .edge-ai-pick-section {
        margin: 0.375rem 0;
    }

    .edge-ai-pick-badge {
        font-size: 0.75rem;
        padding: 0.3125rem 0.75rem;
        border-radius: 1.25rem;
    }

    /* Compact line section */
    .line-section {
        margin: 0;
    }

    .spread-badge {
        font-size: 0.8125rem;
        padding: 0.3125rem 0.625rem;
    }

    /* Compact game info */
    .game-info-section {
        padding-top: 0.375rem;
    }

    /* Results section */
    .results-section {
        padding: 1.25rem;
        margin-bottom: 1.5rem;
    }

    .results-header {
        margin-bottom: 1.25rem;
        padding-bottom: 0.75rem;
    }

    /* Tighter gap between cards */
    .content-chunk .row {
        gap: 0.75rem 0;
    }

    .content-chunk .row > [class*="col-"] {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* 2K+ screens (1920px+) - Maximum density with 5 columns option */
@media (min-width: 1920px) {
    /* Optional: 5 columns for very wide screens */
    .content-chunk .row > [class*="col-lg-4"] {
        flex: 0 0 20%;
        max-width: 20%;
    }

    /* Ultra-compact cards */
    .winner-card,
    .prediction-card,
    .game-card {
        min-height: 340px;
        padding: 0.75rem;
    }

    /* Smaller team logo */
    .team-logo.team-logo-large {
        width: 80px;
        height: 80px;
    }

    /* Compact score */
    .score-value {
        font-size: 1.625rem;
        min-width: 45px;
    }

    .score-dash {
        font-size: 1.125rem;
    }

    /* Very compact spacing */
    .team-matchup-section {
        padding: 0.375rem 0;
    }

    .vs-indicator {
        margin: 0 0.75rem;
        padding-top: 40px;
    }

    .vs-unified {
        font-size: 0.875rem;
    }
}

/* Dark Mode Support */

/* Compact Header - Dark Mode */
[data-theme="dark"] .track-record-header {
    background: #1a1a1a;
    border-bottom-color: #404040;
}

[data-theme="dark"] .header-title h1 {
    color: #e0e0e0;
}

[data-theme="dark"] .title-brand {
    color: #e0e0e0;
}

[data-theme="dark"] .title-divider {
    color: #404040;
}

[data-theme="dark"] .filter-select-compact {
    background: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
}

[data-theme="dark"] .filter-select-compact:hover,
[data-theme="dark"] .filter-select-compact:focus {
    background: #333;
}

[data-theme="dark"] .filter-pills {
    background: #2d2d2d;
}

[data-theme="dark"] .filter-pill span {
    color: #999;
}

[data-theme="dark"] .filter-pill:hover span {
    color: #e0e0e0;
}

[data-theme="dark"] .filter-pill input[type="radio"]:checked + span {
    background: #404040;
    color: #10B981;
}

[data-theme="dark"] .btn-reset-compact {
    border-color: #404040;
    color: #999;
}

[data-theme="dark"] .header-cta {
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .filter-status-bar {
    background: #422006;
    color: #fbbf24;
}

/* Legacy Hero - Dark Mode */
[data-theme="dark"] .track-record-hero {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

[data-theme="dark"] .hero-title {
    color: #e0e0e0;
}

[data-theme="dark"] .hero-subtitle {
    color: #999;
}

[data-theme="dark"] .trust-metric-card {
    background: #2d2d2d;
    border-color: #404040;
}

[data-theme="dark"] .trust-metric-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .trust-metric-value {
    color: #e0e0e0;
}

[data-theme="dark"] .trust-metric-label {
    color: #999;
}

[data-theme="dark"] .hero-cta-button {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .hero-cta-button:hover {
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.5);
}

[data-theme="dark"] .filter-bar,
[data-theme="dark"] .metric-card,
[data-theme="dark"] .results-section {
    background: #2d2d2d;
    border-color: #404040;
}

[data-theme="dark"] .filter-select,
[data-theme="dark"] .segmented-control,
[data-theme="dark"] .radio-group {
    background: #1a1a1a;
    border-color: #404040;
    color: #e0e0e0;
}

[data-theme="dark"] .radio-option span {
    color: #9CA3AF;
}

[data-theme="dark"] .radio-option:hover span {
    color: #e0e0e0;
}

[data-theme="dark"] .radio-option input[type="radio"]:checked + span {
    background: #2a2a2a;
    color: #10B981;
}

[data-theme="dark"] .metric-title,
[data-theme="dark"] .metric-value,
[data-theme="dark"] .results-title {
    color: #e0e0e0;
}

[data-theme="dark"] .metric-label,
[data-theme="dark"] .filter-icon,
[data-theme="dark"] .results-count {
    color: #999;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Micro-interactions */
.interactive-element {
    cursor: pointer;
    transition: all 0.2s ease;
}

.interactive-element:active {
    transform: scale(0.98);
}

/* Tooltips */
.tooltip-wrapper {
    position: relative;
    display: inline-block;
}

.tooltip-content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #212529;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    margin-bottom: 0.5rem;
}

.tooltip-wrapper:hover .tooltip-content {
    opacity: 1;
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #212529 transparent transparent transparent;
}

/* ============================================
   QUALITY TIER WIN RATES CARD
   ============================================ */
.quality-tiers-card {
    /* Special styling for quality tier card */
}

.quality-tiers-card .metric-icon {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}

.quality-tiers-card::before {
    background: linear-gradient(90deg, #F59E0B 0%, #D97706 100%);
}

.quality-tier-breakdown {
    margin-top: 0.5rem;
}

.quality-tier-breakdown .tier-row {
    transition: all 0.2s ease;
}

.quality-tier-breakdown .tier-row:hover {
    background: rgba(16, 185, 129, 0.05);
    border-radius: 4px;
    padding-left: 0.5rem;
    margin-left: -0.5rem;
    padding-right: 0.5rem;
    margin-right: -0.5rem;
}

/* Dark mode support for quality tiers */
[data-theme="dark"] .quality-tiers-card {
    background: #2d2d2d;
    border-color: #404040;
}

[data-theme="dark"] .quality-tiers-card .metric-icon {
    background: rgba(245, 158, 11, 0.2);
}

[data-theme="dark"] .quality-tier-breakdown .tier-row {
    border-color: #404040 !important;
}

[data-theme="dark"] .quality-tier-breakdown .tier-row:hover {
    background: rgba(16, 185, 129, 0.1);
}

/* ============================================
   DECK OF CARDS FAN-OUT EFFECT
   Playful stacked deck that fans on hover
   ============================================ */

/* Fix stacking context */
.game-results-container .row {
    position: relative;
    perspective: 1000px;
}

.game-results-container [class*="col-"] {
    position: relative;
    z-index: 1;
}

/* Ensure cards don't overlap unintentionally */
.winner-card, .prediction-card {
    position: relative;
    z-index: 1;
}

/* Cards at rest - slight stacked appearance */
.game-results-container [class*="col-"] {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                z-index 0.1s;
}

/* Layered shadow pseudo-element for deck depth */
.winner-card::after,
.loss-card::after,
.push-card::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    right: -6px;
    bottom: -6px;
    background: linear-gradient(135deg,
        rgba(var(--card-bg-color-rgb), 0.6) 0%,
        rgba(var(--card-bg-color-rgb), 0.3) 100%);
    border-radius: inherit;
    z-index: -1;
    box-shadow:
        4px 4px 0 rgba(0,0,0,0.05),
        8px 8px 0 rgba(0,0,0,0.03);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Fan-out on row hover - cards spread apart */
.game-results-container .row:hover [class*="col-"]:nth-child(3n+1) {
    transform: translateX(-12px) rotate(-3deg);
    z-index: 3;
}

.game-results-container .row:hover [class*="col-"]:nth-child(3n+2) {
    transform: translateY(-8px) scale(1.02);
    z-index: 4;
}

.game-results-container .row:hover [class*="col-"]:nth-child(3n+3) {
    transform: translateX(12px) rotate(3deg);
    z-index: 3;
}

/* Collapse shadow on hover (card "lifts" from deck) */
.game-results-container .row:hover .winner-card::after,
.game-results-container .row:hover .loss-card::after,
.game-results-container .row:hover .push-card::after {
    top: 2px;
    left: 2px;
    right: -2px;
    bottom: -2px;
    opacity: 0.5;
}

/* Individual card hover - pop out of deck */
.game-results-container [class*="col-"]:hover {
    z-index: 10 !important;
    transform: translateY(-15px) scale(1.03) !important;
}

/* Fan-out effect adapted for 4-column layout (smaller transforms to prevent overlap) */
@media (min-width: 1400px) {
    .game-results-container .row:hover [class*="col-"]:nth-child(4n+1) {
        transform: translateX(-6px) rotate(-1.5deg);
    }
    .game-results-container .row:hover [class*="col-"]:nth-child(4n+2) {
        transform: translateY(-6px) scale(1.01);
    }
    .game-results-container .row:hover [class*="col-"]:nth-child(4n+3) {
        transform: translateY(-6px) scale(1.01);
    }
    .game-results-container .row:hover [class*="col-"]:nth-child(4n+4) {
        transform: translateX(6px) rotate(1.5deg);
    }
    .game-results-container [class*="col-"]:hover {
        transform: translateY(-12px) scale(1.02) !important;
    }
}

/* Entrance animation on page load */
@keyframes dealCard {
    0% {
        opacity: 0;
        transform: translateY(40px) rotate(10deg) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotate(0) scale(1);
    }
}

.game-results-container [class*="col-"] {
    animation: dealCard 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

/* Staggered deal timing */
.game-results-container [class*="col-"]:nth-child(1) { animation-delay: 0.05s; }
.game-results-container [class*="col-"]:nth-child(2) { animation-delay: 0.1s; }
.game-results-container [class*="col-"]:nth-child(3) { animation-delay: 0.15s; }
.game-results-container [class*="col-"]:nth-child(4) { animation-delay: 0.2s; }
.game-results-container [class*="col-"]:nth-child(5) { animation-delay: 0.25s; }
.game-results-container [class*="col-"]:nth-child(6) { animation-delay: 0.3s; }
.game-results-container [class*="col-"]:nth-child(7) { animation-delay: 0.35s; }
.game-results-container [class*="col-"]:nth-child(8) { animation-delay: 0.4s; }
.game-results-container [class*="col-"]:nth-child(9) { animation-delay: 0.45s; }

/* Card corner "dog-ear" fold effect */
.winner-card::before,
.loss-card::before,
.push-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 24px 24px 0;
    border-color: transparent var(--bg-primary) transparent transparent;
    z-index: 10;
    transition: border-width 0.3s ease;
}

.winner-card:hover::before,
.loss-card:hover::before,
.push-card:hover::before {
    border-width: 0 32px 32px 0;
}

/* Win cards get green corner */
.win-card::before {
    border-color: transparent rgba(16, 185, 129, 0.4) transparent transparent;
}

/* Loss cards get red corner */
.loss-card::before {
    border-color: transparent rgba(220, 53, 69, 0.4) transparent transparent;
}

/* Push cards get yellow corner */
.push-card::before {
    border-color: transparent rgba(251, 191, 36, 0.4) transparent transparent;
}

/* Dark mode deck shadows */
[data-theme="dark"] .winner-card::after,
[data-theme="dark"] .loss-card::after,
[data-theme="dark"] .push-card::after {
    background: linear-gradient(135deg,
        rgba(40, 40, 40, 0.8) 0%,
        rgba(30, 30, 30, 0.5) 100%);
    box-shadow:
        4px 4px 0 rgba(0,0,0,0.2),
        8px 8px 0 rgba(0,0,0,0.15);
}

/* Dark mode corner folds */
[data-theme="dark"] .winner-card::before,
[data-theme="dark"] .loss-card::before,
[data-theme="dark"] .push-card::before {
    border-color: transparent var(--bg-secondary) transparent transparent;
}

[data-theme="dark"] .win-card::before {
    border-color: transparent rgba(16, 185, 129, 0.5) transparent transparent;
}

[data-theme="dark"] .loss-card::before {
    border-color: transparent rgba(220, 53, 69, 0.5) transparent transparent;
}

[data-theme="dark"] .push-card::before {
    border-color: transparent rgba(251, 191, 36, 0.5) transparent transparent;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .game-results-container [class*="col-"],
    .winner-card::after,
    .loss-card::after,
    .push-card::after,
    .winner-card::before,
    .loss-card::before,
    .push-card::before {
        animation: none;
        transition: none;
    }

    .game-results-container .row:hover [class*="col-"] {
        transform: none;
    }
}

/* Mobile: Disable fan-out (cards are stacked vertically anyway) */
@media (max-width: 768px) {
    .game-results-container .row:hover [class*="col-"] {
        transform: none;
    }

    .game-results-container [class*="col-"]:hover {
        transform: translateY(-8px) scale(1.01) !important;
    }

    .winner-card::after,
    .loss-card::after,
    .push-card::after {
        top: 3px;
        left: 3px;
        right: -3px;
        bottom: -3px;
        box-shadow:
            2px 2px 0 rgba(0,0,0,0.05),
            4px 4px 0 rgba(0,0,0,0.03);
    }

    .winner-card::before,
    .loss-card::before,
    .push-card::before {
        border-width: 0 18px 18px 0;
    }
}