/* CSS Variables for Geocities theming */
:root {
    --bg-primary: #000000;
    --bg-secondary: #000811;
    --bg-tertiary: #001122;
    --text-primary: #00fff9;
    --text-secondary: #00b8ff;
    --text-muted: #ff00c1;
    --border-color: #00fff9;
    --accent-primary: #ff00c1;
    --accent-secondary: #9600ff;
    --success: #00fff9;
    --warning: #4900ff;
    --error: #ff00c1;
    --shadow-sm: 0 0 5px #00fff9;
    --shadow-md: 0 0 10px #ff00c1, 0 0 20px #00b8ff;
    --shadow-lg: 0 0 15px #9600ff, 0 0 30px #ff00c1;
    --radius-sm: 0px;
    --radius-md: 0px;
    --radius-lg: 0px;
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f0f8ff;
    --bg-tertiary: #e6f3ff;
    --text-primary: #4900ff;
    --text-secondary: #9600ff;
    --text-muted: #ff00c1;
    --border-color: #4900ff;
    --accent-primary: #ff00c1;
    --accent-secondary: #00b8ff;
    --success: #00fff9;
    --warning: #9600ff;
    --error: #ff00c1;
    --shadow-sm: 0 0 5px #4900ff;
    --shadow-md: 0 0 10px #ff00c1, 0 0 20px #9600ff;
    --shadow-lg: 0 0 15px #00b8ff, 0 0 30px #ff00c1;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', 'Monaco', 'Lucida Console', monospace;
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255, 0, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 0, 0.05) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.4;
    text-shadow: 0 0 5px currentColor;
    animation: backgroundPulse 4s ease-in-out infinite alternate;
}

@keyframes backgroundPulse {
    0% { background-color: var(--bg-primary); }
    100% { background-color: var(--bg-secondary); }
}

/* Retro Construction Banner */
.construction-banner {
    background: var(--accent-primary);
    color: var(--bg-primary);
    padding: 0.5rem 0;
    border-bottom: 2px solid var(--accent-secondary);
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-shadow: 0 0 5px currentColor;
    animation: bannerBlink 1s linear infinite;
}

@keyframes bannerBlink {
    0%, 50% { background: var(--accent-primary); }
    51%, 100% { background: var(--accent-secondary); }
}

.construction-banner marquee {
    font-size: 0.9rem;
}

/* App container */
.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: var(--accent-secondary);
    border: 2px solid var(--border-color);
    border-style: double;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
    animation: headerGlow 2s ease-in-out infinite alternate;
}

@keyframes headerGlow {
    0% { box-shadow: 0 0 10px var(--accent-primary), 0 0 20px var(--accent-secondary); }
    100% { box-shadow: 0 0 20px var(--accent-secondary), 0 0 30px var(--accent-primary); }
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.header-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
}

.title {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--accent-primary);
    text-shadow: 2px 2px 4px var(--accent-secondary), 0 0 10px currentColor;
    animation: titleBlink 1.5s linear infinite;
    font-family: 'Courier New', monospace;
    margin: 0;
}

.subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-shadow: 0 0 5px currentColor;
    font-family: 'Courier New', monospace;
    margin: 0;
    font-style: italic;
    animation: subtitleGlow 2s ease-in-out infinite alternate;
}

@keyframes subtitleGlow {
    0% { text-shadow: 0 0 5px currentColor; }
    100% { text-shadow: 0 0 10px currentColor, 0 0 15px var(--accent-primary); }
}

@keyframes titleBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.7; }
}

.theme-toggle {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-style: outset;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    box-shadow: var(--shadow-sm);
    animation: buttonPulse 3s ease-in-out infinite;
}

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

.theme-toggle:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
    border-style: inset;
}

.theme-icon {
    font-size: 1.2rem;
    animation: iconSpin 4s linear infinite;
}

@keyframes iconSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Spinning Globe */
.spinning-globe {
    font-size: 2rem;
    text-shadow: 0 0 20px var(--accent-primary);
    margin-right: 0.5rem;
    display: block;
}

@keyframes globeSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Theme Controls */
.theme-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-label {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--text-primary);
    text-shadow: 0 0 5px currentColor;
    font-weight: bold;
}

.theme-toggle {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-style: outset;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
    border-style: inset;
}

.theme-icon {
    font-size: 1.2rem;
    animation: iconSpin 4s linear infinite;
}

@keyframes iconSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Navigation */
.nav {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-style: double;
    padding: 1rem;
    margin: 1.5rem 0;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    box-shadow: var(--shadow-sm);
}

.nav::-webkit-scrollbar {
    display: none;
}

.nav-item {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-style: outset;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: bold;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    text-shadow: 0 0 5px currentColor;
    font-family: 'Courier New', monospace;
    animation: navItemFloat 2s ease-in-out infinite alternate;
}

@keyframes navItemFloat {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-2px); }
}

.nav-item:hover {
    background: var(--accent-secondary);
    color: var(--bg-primary);
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
    border-style: inset;
}

.nav-item.active {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-style: inset;
    box-shadow: var(--shadow-lg);
    animation: activeNavPulse 1s ease-in-out infinite alternate;
}

@keyframes activeNavPulse {
    0% { box-shadow: var(--shadow-lg); }
    100% { box-shadow: 0 0 20px var(--accent-primary), 0 0 40px var(--accent-secondary); }
}

/* Filters Section */
.filters-section {
    position: relative;
    margin: 1rem 0;
}

.filters-toggle {
    position: absolute;
    top: -0.5rem;
    right: 1rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

.filters-toggle:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-primary);
    transform: scale(1.1);
}

.filters-toggle.hidden {
    display: none;
}

.filters-icon {
    font-size: 1rem;
    animation: iconBounce 2s ease-in-out infinite;
}

.filters-content {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-style: double;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.filters-content.hidden {
    display: none;
}

.filters-content:not(.hidden) {
    display: block;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.filters-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

.filters-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.filters-close:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    transform: scale(1.1);
}

/* Filters */
.filters {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-style: double;
    padding: 1rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 120px;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: bold;
    color: var(--text-secondary);
    text-shadow: 0 0 5px currentColor;
    font-family: 'Courier New', monospace;
}

.filter-group select {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-style: outset;
    padding: 0.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 3px currentColor;
    box-shadow: var(--shadow-sm);
}

.filter-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
    border-style: inset;
}

.search-input,
.date-input,
.score-input {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-style: outset;
    padding: 0.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: 'Courier New', monospace;
    transition: border-color 0.2s ease;
}

.search-input:focus,
.date-input:focus,
.score-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
    border-style: inset;
}

.multi-select {
    min-height: 100px;
}

.filter-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

.date-range-group,
.score-range-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-range-group span,
.score-range-group span {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.filter-presets {
    flex: 1;
    min-width: 150px;
}

@media (max-width: 768px) {
    .date-range-group,
    .score-range-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .date-range-group span,
    .score-range-group span {
        text-align: center;
    }
    
    .filter-actions {
        flex-direction: column;
    }
    
    .filter-presets {
        width: 100%;
    }
}

/* Main content */
.main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    padding-bottom: 300px; /* Extra scrolling distance to clear fixed widget */
    width: 100%;
}

.section {
    display: none;
    padding-bottom: 200px; /* Add blank space at bottom of each section */
}

.section.active {
    display: block;
}

/* Ensure last section has extra space */
.section:last-child {
    padding-bottom: 250px; /* Even more space for last section */
}

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

.section-header h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
}

.overview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
    gap: 1rem;
}

.overview-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.875rem;
    font-weight: 700;
}

.last-updated-timestamp {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.timestamp-icon {
    font-size: 1rem;
}

.timestamp-text {
    font-family: 'Courier New', monospace;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-style: double;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-sm);
    animation: statCardFloat 3s ease-in-out infinite alternate;
}

@keyframes statCardFloat {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-3px); }
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-style: inset;
}

/* Winner and Loser Card Styling */
.winner-card {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-color: var(--accent-primary);
    animation: winnerGlow 3s ease-in-out infinite;
}

.winner-card .stat-icon {
    animation: iconBounce 2s ease-in-out infinite;
}

.loser-card {
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    border-color: var(--text-secondary);
    opacity: 0.8;
}

.loser-card .stat-icon {
    animation: iconBounce 2s ease-in-out infinite;
}

@keyframes winnerGlow {
    0%, 100% { box-shadow: var(--shadow-sm); }
    50% { box-shadow: 0 0 20px var(--accent-primary), var(--shadow-sm); }
}

.stat-icon {
    font-size: 2rem;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    border: 2px solid var(--accent-secondary);
    border-style: outset;
    color: var(--bg-primary);
    animation: iconBounce 2s ease-in-out infinite;
    text-shadow: 0 0 10px currentColor;
}

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

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    text-shadow: 0 0 10px currentColor;
    animation: valueGlow 2s ease-in-out infinite alternate;
    font-family: 'Courier New', monospace;
}

@keyframes valueGlow {
    0% { text-shadow: 0 0 10px currentColor; }
    100% { text-shadow: 0 0 20px currentColor, 0 0 30px var(--accent-primary); }
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: bold;
    text-shadow: 0 0 5px currentColor;
    font-family: 'Courier New', monospace;
}

/* Chart containers */
.chart-container {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-style: double;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    height: 400px; /* Fixed height */
    position: relative;
    box-shadow: var(--shadow-md);
    animation: chartContainerPulse 4s ease-in-out infinite alternate;
}

@keyframes chartContainerPulse {
    0% { box-shadow: var(--shadow-md); }
    100% { box-shadow: var(--shadow-lg); }
}

.chart-container h3 {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-shadow: 0 0 10px currentColor;
    font-family: 'Courier New', monospace;
    animation: headingBlink 2s linear infinite;
}

@keyframes headingBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.8; }
}

.chart-container canvas {
    max-height: 350px !important;
    height: 350px !important;
}

/* Leaderboard Date Display */
.leaderboard-date {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: var(--text-primary);
    text-shadow: 0 0 5px currentColor;
}

.leaderboard-date.hidden {
    display: none;
}

/* Leaderboard Sort Indicator */
.leaderboard-sort {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: var(--text-primary);
    text-shadow: 0 0 5px currentColor;
}

.leaderboard-sort.hidden {
    display: none;
}

/* Leaderboard specific spacing */
#leaderboard .chart-container {
    margin-bottom: 2rem;
}

#leaderboard .leaderboard-table {
    margin-bottom: 2rem;
}

/* Leaderboard table */
.leaderboard-table {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

tbody tr:hover {
    background: var(--bg-tertiary);
}

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

/* Analytics grid */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.analytics-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-style: double;
    padding: 1.5rem;
    height: 400px; /* Fixed height */
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
    animation: chartContainerPulse 4s ease-in-out infinite alternate;
}

.analytics-card h3 {
    font-size: 1.125rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-shadow: 0 0 10px currentColor;
    font-family: 'Courier New', monospace;
    animation: headingBlink 2s linear infinite;
    flex-shrink: 0;
}

.analytics-card canvas {
    flex: 1;
    max-height: 300px !important;
    height: 300px !important;
}

/* Buttons */
.btn {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: 2px solid var(--accent-secondary);
    border-style: outset;
    padding: 0.5rem 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 5px currentColor;
    box-shadow: var(--shadow-sm);
    animation: buttonGlow 3s ease-in-out infinite alternate;
}

@keyframes buttonGlow {
    0% { box-shadow: var(--shadow-sm); }
    100% { box-shadow: var(--shadow-md); }
}

.btn:hover {
    background: var(--accent-secondary);
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
    border-style: inset;
}

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

.btn-secondary:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-secondary);
}

.btn.active {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-style: inset;
    box-shadow: var(--shadow-lg);
}

.leaderboard-controls {
    display: flex;
    gap: 0.5rem;
}

/* Loading overlay */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    color: var(--text-primary);
}

.loading.hidden {
    display: none;
}

.loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .main {
        padding-bottom: 350px; /* Extra mobile padding */
    }
    
    .section {
        padding-bottom: 250px; /* More mobile padding for sections */
    }
    
    .section:last-child {
        padding-bottom: 300px; /* Even more for last section on mobile */
    }
    
    .header-content {
        flex-direction: row;
        gap: 0.5rem;
        text-align: left;
        align-items: center;
    }
    
    .header-text {
        flex: 1;
    }
    
    .header-controls {
        gap: 0.5rem;
    }
    
    .spinning-globe {
        font-size: 1.5rem;
    }
    
    .theme-label {
        font-size: 0.75rem;
    }
    
    .title {
        font-size: 1.25rem;
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: auto;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .leaderboard-controls {
        justify-content: center;
    }
    
    .chart-container {
        padding: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-icon {
        font-size: 1.5rem;
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    /* Make table responsive */
    .leaderboard-table {
        overflow-x: auto;
    }
    
    table {
        min-width: 600px;
    }
    
    th, td {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .main {
        padding: 0.5rem;
    }
    
    .chart-container {
        padding: 0.75rem;
    }
    
    .stat-card {
        padding: 0.75rem;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .stat-icon {
        font-size: 1.25rem;
        width: 2rem;
        height: 2rem;
    }
    
    .nav-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* Chart.js responsive adjustments */
canvas {
    max-width: 100%;
    height: auto !important;
}

/* Smooth transitions */
* {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Focus styles for accessibility */
button:focus,
select:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Raw Data Section */
.raw-data-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.rows-per-page {
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
}

#page-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
    min-width: 80px;
    text-align: center;
}

.raw-data-info {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-style: double;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 2rem;
    font-family: 'Courier New', monospace;
}

.raw-data-info p {
    margin: 0;
    color: var(--text-primary);
    font-weight: bold;
}

.raw-data-info span {
    color: var(--accent-primary);
    text-shadow: 0 0 5px currentColor;
}

.raw-data-table-container {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-style: double;
    border-radius: 4px;
    overflow-x: auto;
    max-height: 70vh;
    overflow-y: auto;
}

.raw-data-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.raw-data-table th {
    background: var(--accent-primary);
    color: var(--bg-primary);
    padding: 0.75rem 0.5rem;
    text-align: left;
    font-weight: bold;
    border: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.raw-data-table td {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.raw-data-table tbody tr:nth-child(even) {
    background: var(--bg-tertiary);
}

.raw-data-table tbody tr:hover {
    background: var(--accent-secondary);
    color: var(--bg-primary);
}

.raw-data-table td:nth-child(1) { /* User column */
    font-weight: bold;
    color: var(--accent-primary);
}

.raw-data-table td:nth-child(2) { /* Date column */
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.raw-data-table td:nth-child(3), /* Location # */
.raw-data-table td:nth-child(4), /* Location Score */
.raw-data-table td:nth-child(5) { /* Total Score */
    text-align: center;
    font-weight: bold;
}

.raw-data-table td:nth-child(6) { /* Emoji column */
    text-align: center;
    font-size: 1.2rem;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

/* Retro Maptap Widget */
.maptap-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 280px;
    height: 200px;
    background: var(--bg-secondary);
    border: 3px solid #00fff9;
    border-style: double;
    box-shadow: 
        0 0 15px #00fff9,
        0 0 30px #ff00c1,
        0 10px 20px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    z-index: 1000;
    overflow: hidden;
    animation: widgetPulse 3s ease-in-out infinite alternate;
    font-family: 'Courier New', monospace;
}

@keyframes widgetPulse {
    0% { 
        box-shadow: 
            0 0 15px #00fff9,
            0 0 30px #ff00c1,
            0 10px 20px rgba(0, 0, 0, 0.5);
    }
    100% { 
        box-shadow: 
            0 0 25px #00fff9,
            0 0 50px #ff00c1,
            0 15px 30px rgba(0, 0, 0, 0.7);
    }
}

.maptap-widget:hover {
    transform: scale(1.05);
    border-color: #ff00c1;
    animation: widgetHover 0.5s ease-in-out infinite alternate;
}

@keyframes widgetHover {
    0% { transform: scale(1.05); }
    100% { transform: scale(1.08); }
}

.widget-header {
    background: linear-gradient(45deg, #00fff9, #ff00c1);
    padding: 8px;
    text-align: center;
    border-bottom: 2px solid #00fff9;
}

.widget-title {
    display: block;
    font-size: 0.9rem;
    font-weight: bold;
    color: #000000;
    text-shadow: 0 0 5px #ffffff;
    animation: titleBlink 1s linear infinite;
}

.widget-subtitle {
    display: block;
    font-size: 0.7rem;
    color: #000000;
    text-shadow: 0 0 3px #ffffff;
    margin-top: 2px;
}

.widget-iframe {
    width: 100%;
    height: 120px;
    border: none;
    background: var(--bg-primary);
    pointer-events: none;
}

.widget-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.maptap-widget:hover .widget-overlay {
    opacity: 1;
}

.play-button {
    background: linear-gradient(45deg, #ff00c1, #00fff9);
    color: #000000;
    padding: 8px 16px;
    border: 2px solid #ffffff;
    border-style: outset;
    font-weight: bold;
    font-size: 0.8rem;
    text-shadow: 0 0 5px #ffffff;
    animation: playButtonPulse 1s ease-in-out infinite alternate;
    box-shadow: 0 0 10px #ffffff;
}

@keyframes playButtonPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

.widget-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.maptap-widget:hover .widget-overlay {
    opacity: 1;
}

/* Mobile responsive widget */
@media (max-width: 768px) {
    .maptap-widget {
        width: 240px;
        height: 160px;
        bottom: 15px;
        right: 15px;
    }
    
    .widget-iframe {
        height: 100px;
    }
    
    .widget-title {
        font-size: 0.8rem;
    }
    
    .widget-subtitle {
        font-size: 0.6rem;
    }
    
    .play-button {
        font-size: 0.7rem;
        padding: 6px 12px;
    }
    
    /* Always show overlay on mobile */
    .widget-overlay {
        opacity: 1;
    }
    
    /* Raw data mobile adjustments */
    .raw-data-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .raw-data-table {
        font-size: 0.75rem;
    }
    
    .raw-data-table th,
    .raw-data-table td {
        padding: 0.25rem;
    }
    
    .raw-data-table-container {
        max-height: 60vh;
    }
}

/* Streaks Section */
.streaks-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
}

.streaks-section h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.streaks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.streak-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 1rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.streak-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.streak-card.active {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

.streak-card .streak-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.streak-card .streak-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-primary);
    margin-bottom: 0.25rem;
}

.streak-card.active .streak-value {
    color: var(--accent-primary);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.streak-card .streak-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.streak-card .streak-player {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.streak-card .streak-dates {
    font-size: 0.75rem;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .streaks-grid {
        grid-template-columns: 1fr;
    }
}

/* Location Performance Section */
.location-performance-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
}

.location-performance-section h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.location-heatmap-container {
    overflow-x: auto;
}

#location-heatmap {
    display: grid;
    grid-template-columns: auto repeat(5, 1fr);
    gap: 0.5rem;
    min-width: 600px;
}

.location-heatmap-header {
    font-weight: bold;
    color: var(--text-primary);
    padding: 0.5rem;
    text-align: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.location-heatmap-cell {
    padding: 0.75rem;
    text-align: center;
    border: 1px solid var(--border-color);
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
}

.location-heatmap-cell:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-sm);
    z-index: 1;
    position: relative;
}

.location-heatmap-cell.player-name {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: bold;
    text-align: left;
    padding-left: 1rem;
}

.location-heatmap-cell.location-header {
    background: var(--accent-secondary);
    color: var(--bg-primary);
    font-weight: bold;
}

/* Color scale for location scores */
.location-heatmap-cell.score-high {
    background: rgba(0, 255, 249, 0.3);
    color: var(--text-primary);
}

.location-heatmap-cell.score-medium {
    background: rgba(150, 0, 255, 0.3);
    color: var(--text-primary);
}

.location-heatmap-cell.score-low {
    background: rgba(255, 0, 193, 0.3);
    color: var(--text-primary);
}

.location-heatmap-cell.nemesis {
    border: 2px solid var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

@media (max-width: 768px) {
    .location-heatmap-container {
        font-size: 0.8rem;
    }
    
    .location-heatmap-cell {
        padding: 0.5rem;
    }
}

/* Trends Controls */
.trends-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.trends-filters-panel {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: bold;
}

.filter-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

.trends-player-select {
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    min-height: 100px;
}

.trends-player-select option {
    padding: 0.25rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.date-input {
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
}

.period-selector {
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
}

.rolling-average-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.9rem;
}

.rolling-average-toggle input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
}

.quick-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    grid-column: 1 / -1;
}

/* Trend Insights */
.trend-insights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.insight-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-left: 4px solid var(--accent-primary);
}

.insight-card.insight-best {
    border-left-color: #00fff9;
}

.insight-card.insight-worst {
    border-left-color: #ff00c1;
}

.insight-card.insight-trend.trend-up {
    border-left-color: #00fff9;
}

.insight-card.insight-trend.trend-down {
    border-left-color: #ff00c1;
}

.insight-card.insight-recent {
    border-left-color: #9600ff;
}

.insight-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.insight-content {
    flex: 1;
}

.insight-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.insight-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.insight-details {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Player Mini Charts */
.player-mini-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.mini-chart-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    padding: 1rem;
}

.mini-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.mini-chart-header h4 {
    color: var(--text-primary);
    font-size: 1rem;
    margin: 0;
}

.mini-chart-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.trend-indicator {
    font-weight: bold;
}

.trend-indicator.trend-up {
    color: #00fff9;
}

.trend-indicator.trend-down {
    color: #ff00c1;
}

.mini-chart-container {
    height: 150px;
    position: relative;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.period-summaries {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.period-summary-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    padding: 1rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.period-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.period-summary-card .period-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: bold;
}

.period-trend {
    font-size: 0.85rem;
    font-weight: bold;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.period-trend.trend-up {
    color: #00fff9;
    background: rgba(0, 255, 249, 0.1);
}

.period-trend.trend-down {
    color: #ff00c1;
    background: rgba(255, 0, 193, 0.1);
}

.period-summary-card .period-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--accent-primary);
    margin-bottom: 0.25rem;
}

.period-summary-card .period-details {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.period-stats {
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.period-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

@media (max-width: 768px) {
    .trends-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .trends-filters-panel {
        grid-template-columns: 1fr;
    }
    
    .trend-insights {
        grid-template-columns: 1fr;
    }
    
    .player-mini-charts {
        grid-template-columns: 1fr;
    }
    
    .period-summaries {
        grid-template-columns: 1fr;
    }
}

/* Advanced Analytics Section */
.advanced-analytics-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
}

.advanced-analytics-section h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.player-analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.player-analytics-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 4px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.player-analytics-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.analytics-card-header h4 {
    margin: 0 0 1rem 0;
    color: var(--accent-primary);
    font-size: 1.2rem;
}

.analytics-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.analytics-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.analytics-stat .stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.analytics-stat .stat-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-primary);
}

.analytics-stat .stat-value.positive {
    color: #00fff9;
}

.analytics-stat .stat-value.negative {
    color: #ff00c1;
}

.h2h-summary {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.h2h-summary h5 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 1rem;
}

.h2h-best,
.h2h-worst {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.h2h-best {
    background: rgba(0, 255, 249, 0.1);
    color: var(--text-primary);
}

.h2h-worst {
    background: rgba(255, 0, 193, 0.1);
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .player-analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .analytics-stats {
        grid-template-columns: 1fr;
    }
}

/* Achievements Section */
.achievements-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
}

.achievements-section h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.achievements-leaderboard {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.achievement-leaderboard-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 4px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.achievement-leaderboard-card:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.achievement-rank {
    font-size: 1.5rem;
    min-width: 50px;
    text-align: center;
}

.achievement-player-info {
    flex: 1;
}

.achievement-player-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.achievement-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.achievement-badges-preview {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge-icon {
    font-size: 1.5rem;
    cursor: help;
}

.badge-more {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: bold;
}

/* Profile Achievements */
.profile-achievements {
    margin-top: 2rem;
}

.profile-achievements h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.achievement-badge {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    padding: 1rem;
    border-radius: 4px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.achievement-badge:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-primary);
}

.achievement-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.achievement-info {
    flex: 1;
}

.achievement-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--accent-primary);
    margin-bottom: 0.25rem;
}

.achievement-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.achievement-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

@media (max-width: 768px) {
    .achievements-grid {
        grid-template-columns: 1fr;
    }
    
    .achievement-leaderboard-card {
        flex-direction: column;
        text-align: center;
    }
}

/* Insights Section */
.insights-section,
.predictions-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
}

.insights-section h3,
.predictions-section h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.insights-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.insight-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.insight-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.insight-card.insight-positive {
    border-left: 4px solid #00fff9;
}

.insight-card.insight-accent {
    border-left: 4px solid #ff00c1;
}

.insight-card.insight-info {
    border-left: 4px solid #00b8ff;
}

.insight-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.insight-content {
    flex: 1;
}

.insight-title {
    font-weight: bold;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.insight-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Predictions Section */
.predictions-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.prediction-card {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 4px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    cursor: pointer;
}

.prediction-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-primary);
}

.prediction-player {
    font-weight: bold;
    font-size: 1rem;
    color: var(--accent-primary);
    margin-bottom: 0.75rem;
}

.prediction-score {
    margin-bottom: 0.75rem;
}

.predicted-value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.predicted-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.prediction-trend {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.confidence-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}

.confidence-badge.high {
    background: rgba(0, 255, 249, 0.2);
    color: #00fff9;
}

.confidence-badge.medium {
    background: rgba(150, 0, 255, 0.2);
    color: #9600ff;
}

.recommendation-card {
    grid-column: 1 / -1;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--accent-primary);
    border-radius: 4px;
    margin-top: 1rem;
}

.recommendation-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.recommendation-content {
    flex: 1;
}

.recommendation-title {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.recommendation-message {
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.5;
}

@media (max-width: 768px) {
    .insights-container,
    .predictions-container {
        grid-template-columns: 1fr;
    }
    
    .recommendation-card {
        grid-column: 1;
    }
}

/* Skeleton Loading States */
.skeleton-loading {
    width: 100%;
    padding: 2rem;
    animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-chart {
    width: 100%;
    height: 300px;
    background: linear-gradient(90deg, 
        var(--bg-secondary) 0%, 
        var(--bg-tertiary) 50%, 
        var(--bg-secondary) 100%);
    background-size: 200% 100%;
    border: 2px solid var(--border-color);
    animation: shimmer 2s infinite;
}

.skeleton-text {
    height: 20px;
    background: linear-gradient(90deg, 
        var(--bg-secondary) 0%, 
        var(--bg-tertiary) 50%, 
        var(--bg-secondary) 100%);
    background-size: 200% 100%;
    margin-bottom: 1rem;
    border-radius: 4px;
    animation: shimmer 2s infinite;
}

.skeleton-text:nth-child(2) {
    width: 80%;
}

.skeleton-text:nth-child(3) {
    width: 60%;
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.empty-state-message {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Tooltips */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.95);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.875rem;
    z-index: 1000;
    pointer-events: none;
    box-shadow: var(--shadow-md);
    max-width: 250px;
    word-wrap: break-word;
}

.has-tooltip {
    cursor: help;
    position: relative;
}

/* Error Messages */
.error-message {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 0, 193, 0.1);
    border: 2px solid var(--error);
    color: var(--text-primary);
    margin: 1rem;
    border-radius: 4px;
    animation: slideIn 0.3s ease-out;
}

.error-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.error-text {
    flex: 1;
    font-weight: bold;
}

.error-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.error-close:hover {
    color: var(--error);
}

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

/* Chart Improvements */
.chart-container {
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chart-container:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Loading Spinner Enhancement */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-secondary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Data Quality Section */
.data-quality-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
}

.data-quality-section h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.data-quality-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.quality-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.quality-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.quality-card.quality-info {
    border-left: 4px solid #00b8ff;
}

.quality-card.quality-warning {
    border-left: 4px solid #ffaa00;
}

.quality-card.quality-alert {
    border-left: 4px solid #ff00c1;
}

.quality-card.quality-fresh {
    border-left: 4px solid #00fff9;
}

.quality-card.quality-recent {
    border-left: 4px solid #ffff00;
}

.quality-card.quality-stale {
    border-left: 4px solid #ff8800;
}

.quality-card.quality-outdated {
    border-left: 4px solid #ff0000;
}

.quality-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.quality-content {
    flex: 1;
}

.quality-title {
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quality-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.quality-details {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

@media (max-width: 768px) {
    .data-quality-container {
        grid-template-columns: 1fr;
    }
}

/* Advanced Visualizations */
.advanced-visualizations-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
}

.advanced-visualizations-section h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.advanced-viz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.advanced-viz-grid .analytics-card.full-width {
    grid-column: 1 / -1;
}

.viz-select {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 1rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* Correlation Matrix */
.correlation-matrix {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.correlation-card {
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    text-align: center;
}

.correlation-pair {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.correlation-arrow {
    color: var(--accent-primary);
    font-size: 1.2rem;
}

.correlation-value {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.correlation-value.positive {
    color: #00fff9;
}

.correlation-value.negative {
    color: #ff00c1;
}

.correlation-strength {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Calendar Heatmap */
.calendar-heatmap-container {
    margin-top: 1rem;
}

.calendar-heatmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12px, 1fr));
    gap: 2px;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    overflow-x: auto;
}

.heatmap-cell {
    aspect-ratio: 1;
    min-width: 12px;
    min-height: 12px;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.heatmap-cell:hover {
    transform: scale(1.2);
    box-shadow: var(--shadow-md);
    z-index: 10;
}

.heatmap-month-label {
    position: absolute;
    top: -20px;
    left: 0;
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.5rem;
}

.legend-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-cells {
    display: flex;
    gap: 2px;
}

.legend-cell {
    width: 12px;
    height: 12px;
    border: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    .advanced-viz-grid {
        grid-template-columns: 1fr;
    }
    
    .correlation-matrix {
        grid-template-columns: 1fr;
    }
    
    .calendar-heatmap-grid {
        grid-template-columns: repeat(auto-fill, minmax(10px, 1fr));
    }
}

/* Accessibility Improvements */

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus indicators */
*:focus-visible {
    outline: 3px solid var(--accent-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 5px var(--accent-primary);
}

button:focus-visible,
.nav-item:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid var(--accent-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 5px var(--accent-primary);
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-primary);
    color: var(--bg-primary);
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
    font-weight: bold;
}

.skip-link:focus {
    top: 0;
}

/* High contrast mode */
[data-theme="high-contrast"] {
    --bg-primary: #000000;
    --bg-secondary: #000000;
    --bg-tertiary: #000000;
    --text-primary: #ffffff;
    --text-secondary: #ffffff;
    --text-muted: #ffffff;
    --border-color: #ffffff;
    --accent-primary: #ffff00;
    --accent-secondary: #ffff00;
    --success: #00ff00;
    --warning: #ffaa00;
    --error: #ff0000;
}

[data-theme="high-contrast"] * {
    border-color: #ffffff !important;
}

[data-theme="high-contrast"] button,
[data-theme="high-contrast"] .nav-item,
[data-theme="high-contrast"] .stat-card {
    border: 2px solid #ffffff;
}

[data-theme="high-contrast"] *:focus-visible {
    outline: 4px solid #ffff00;
    outline-offset: 3px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .spinning-globe {
        animation: none !important;
    }
}

/* Keyboard navigation improvements */
.nav-item:focus,
button:focus,
input:focus,
select:focus {
    position: relative;
    z-index: 10;
}

/* ARIA live regions */
.aria-live {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Better contrast for links */
a {
    text-decoration: underline;
}

a:focus {
    outline: 3px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Player Profile Section */
.profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.profile-content {
    padding: 1rem 0;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.profile-stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.profile-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.profile-stat-card.active-streak {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

.profile-stat-card .stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.profile-stat-card .stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-primary);
    margin-bottom: 0.25rem;
}

.profile-stat-card .stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.profile-nemesis {
    background: var(--bg-secondary);
    border: 2px solid var(--accent-primary);
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.profile-nemesis h3 {
    margin: 0 0 0.5rem 0;
    color: var(--accent-primary);
}

.profile-location-performance {
    margin-bottom: 2rem;
}

.profile-location-performance h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.location-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.location-stat {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 1rem;
    text-align: center;
}

.location-stat.nemesis {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

.location-stat .location-number {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.location-stat .location-avg {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.location-stat .location-range {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.profile-performance-calendar {
    margin-top: 2rem;
}

.profile-performance-calendar h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
}

.calendar-cell {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    text-align: center;
    font-size: 0.85rem;
    transition: transform 0.2s;
}

.calendar-cell:hover {
    transform: scale(1.05);
    z-index: 1;
    position: relative;
}

.calendar-cell.score-excellent {
    background: rgba(0, 255, 249, 0.3);
    border-color: #00fff9;
}

.calendar-cell.score-good {
    background: rgba(0, 184, 255, 0.3);
    border-color: #00b8ff;
}

.calendar-cell.score-average {
    background: rgba(150, 0, 255, 0.3);
    border-color: #9600ff;
}

.calendar-cell.score-poor {
    background: rgba(255, 0, 193, 0.3);
    border-color: #ff00c1;
}

.calendar-cell .calendar-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.calendar-cell .calendar-score {
    font-weight: bold;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .location-breakdown {
        grid-template-columns: 1fr;
    }
    
    .calendar-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Comparison Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--accent-primary);
}

.modal-body {
    color: var(--text-primary);
}

.comparison-player-selectors {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.comparison-player-select {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comparison-player-select label {
    min-width: 80px;
    color: var(--text-secondary);
}

.comparison-player-select select {
    flex: 1;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: inherit;
}

.comparison-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Comparison View */
.comparison-view {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
}

.comparison-view.hidden {
    display: none;
}

.comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.comparison-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.comparison-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.comparison-stat-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 1rem;
    text-align: center;
}

.comparison-stat-card h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
}

.comparison-stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.comparison-stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.comparison-head-to-head {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 1rem;
    margin-bottom: 2rem;
    text-align: center;
}

.comparison-head-to-head h4 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
}

.comparison-head-to-head .head-to-head-stats {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.comparison-head-to-head .head-to-head-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.comparison-head-to-head .head-to-head-stat .value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-primary);
}

.comparison-head-to-head .head-to-head-stat .label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 1rem;
    }
    
    .comparison-stats {
        grid-template-columns: 1fr;
    }
    
    .comparison-head-to-head .head-to-head-stats {
        flex-direction: column;
    }
}

/* Mobile Enhancements */
.pull-refresh-indicator {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 1rem 2rem;
    border-radius: 0 0 1rem 1rem;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    font-size: 0.9rem;
    text-align: center;
}

/* Increase touch target sizes on mobile */
@media (max-width: 768px) {
    .btn,
    button {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    .btn-sm {
        min-height: 40px;
        padding: 0.6rem 0.9rem;
    }
    
    .nav-item {
        min-height: 48px;
        padding: 0.75rem 1rem;
    }
    
    .stat-card,
    .streak-card,
    .period-summary-card {
        min-height: 44px;
    }
    
    /* Simplify charts on mobile */
    .chart-container {
        max-height: 300px;
    }
    
    .chart-container canvas {
        max-height: 300px;
    }
    
    /* Optimize table scrolling on mobile */
    .raw-data-table-container {
        -webkit-overflow-scrolling: touch;
    }
    
    .raw-data-table {
        font-size: 0.8rem;
    }
    
    .raw-data-table th,
    .raw-data-table td {
        padding: 0.75rem 0.5rem;
    }
    
    /* Larger filter inputs on mobile */
    .search-input,
    .date-input,
    .score-input,
    select {
        min-height: 44px;
        font-size: 1rem;
    }
    
    /* Better spacing for mobile */
    .section-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    /* Swipe hint */
    .swipe-hint {
        display: block;
        text-align: center;
        color: var(--text-muted);
        font-size: 0.85rem;
        padding: 0.5rem;
        margin-bottom: 1rem;
    }
}

/* Hide swipe hint on desktop */
.swipe-hint {
    display: none;
}

@media (max-width: 768px) {
    .swipe-hint {
        display: block;
    }
}

/* Prevent text selection during swipe */
@media (max-width: 768px) {
    .nav,
    .section {
        -webkit-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
    }
    
    /* Allow text selection in tables and content */
    .raw-data-table,
    .stat-card,
    .streak-card {
        -webkit-user-select: text;
        user-select: text;
    }
}
