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

:root {
    --primary-color: #5865F2;
    --secondary-color: #57F287;
    --background: #1a1a1a;
    --surface: #2b2b2b;
    --surface-light: #363636;
    --text-primary: #ffffff;
    --text-secondary: #b9bbbe;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border-radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    /* Safe area insets for notched devices */
    padding-top: constant(safe-area-inset-top); /* iOS 11.0 */
    padding-top: env(safe-area-inset-top); /* iOS 11.2+ */
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
}

/* Landing Page */
.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

.container header {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--surface);
    text-align: center;
    padding: 60px 20px 20px;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.home-logo {
    height: 120px;
    width: auto;
    display: block;
    margin: 0 auto 10px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.hero {
    text-align: center;
    padding: 40px 20px;
    background: var(--surface);
    border-radius: var(--border-radius);
    margin: 40px auto;
    max-width: 1200px;
}

.welcome, .login-prompt {
    padding: 20px;
}

.avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin-bottom: 20px;
    border: 4px solid var(--primary-color);
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    margin: 10px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: #4752c4;
    transform: translateY(-2px);
}

.btn-primary i {
    width: 18px;
    height: 18px;
}

.btn-secondary {
    background: var(--surface-light);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: #4a4a4a;
    transform: translateY(-2px);
}

.btn-secondary.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.3);
}

.btn-secondary.active:hover {
    background: #4752c4;
}

.btn-secondary i {
    width: 18px;
    height: 18px;
}

.btn-discord {
    background: var(--primary-color);
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-discord:hover {
    background: #4752c4;
    transform: translateY(-2px);
}

.or-divider {
    color: var(--text-secondary);
    margin: 20px 0;
    font-size: 0.9rem;
}

.how-it-works {
    background: var(--surface);
    padding: 60px 40px;
    max-width: 1200px;
    margin: 40px auto;
    border-radius: var(--border-radius);
    text-align: center;
}

.how-it-works h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 50px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.steps {
    display: contents;
}

.step {
    background: var(--background);
    padding: 40px 30px;
    border-radius: 16px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--surface-light);
    position: relative;
    text-align: center;
}

.step:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
}

.step-icon-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
}

.step-number-badge {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.step-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 16px;
}

.step-icon i {
    width: 40px;
    height: 40px;
    color: var(--primary-color);
}

.step h3 {
    font-size: 1.25rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.step p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

.step a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.step a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin: 50px auto;
    max-width: 1200px;
}

.step:nth-child(1),
.step:nth-child(2),
.step:nth-child(3) {
    grid-column: span 1;
}

.step:nth-child(4) {
    grid-column: 1 / 2;
}

.cta-box-inline {
    grid-column: 2 / 4;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
    padding: 40px 30px;
    border-radius: 16px;
    border: 1px solid var(--surface-light);
    position: relative;
    overflow: hidden;
}

.discord-bg-effect {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 15px;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.discord-logo-row {
    display: flex;
    gap: 32px;
    justify-content: center;
}

.discord-logo-row:nth-child(even) {
    transform: translateX(16px);
}

.discord-logo-bg {
    width: 24px;
    height: 24px;
    color: rgba(88, 101, 242, 0.06);
    transition: all 0.15s ease;
    flex-shrink: 0;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-5px) rotate(3deg);
    }
}

.cta-buttons-group {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
}

.cta-box-inline .btn {
    padding: 16px 32px;
    font-size: 1.1rem;
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .cta-buttons-group {
        flex-direction: column;
        width: 100%;
    }

    .cta-buttons-group .btn {
        width: 100%;
    }
}

/* Hero Showcase Section */
.hero-showcase {
    background: var(--background);
    padding: 60px 20px 80px;
    max-width: 1400px;
    margin: 0 auto;
}

.hero-content {
    text-align: center;
    margin-bottom: 60px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.6;
}

.hero-cta {
    margin-top: 30px;
}

.hero-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    margin-bottom: 20px;
}

.hero-cta h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: var(--text-primary);
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
    line-height: 1.7;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
    padding: 20px 0;
    overflow: visible;
}

.btn-with-description {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
}

.btn-step {
    position: relative;
    padding-left: 50px;
}

.step-number {
    position: absolute;
    left: -12px;
    top: -12px;
    min-width: 60px;
    height: 28px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    padding: 0 10px;
    white-space: nowrap;
}

.btn-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.btn-main-text {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
}

.btn-sub-text {
    font-size: 0.75rem;
    opacity: 0.85;
    font-weight: 400;
    line-height: 1.2;
}

.btn-large {
    padding: 14px 32px;
    font-size: 1.1rem;
}

.showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 500px), 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.showcase-item {
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--surface-light);
}

.showcase-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.15);
}

.showcase-image {
    width: 100%;
    height: auto;
    display: block;
    border-bottom: 1px solid var(--surface-light);
}

.showcase-caption {
    padding: 25px;
}

.showcase-caption h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.showcase-caption p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 60px auto;
    max-width: 1200px;
    padding: 0 20px;
}

.feature-card {
    background: var(--surface);
    padding: 30px;
    border-radius: var(--border-radius);
    text-align: center;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
}

/* Dashboard */
.dashboard-container {
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    min-height: 100vh; /* Fallback for older browsers */
    display: flex;
    flex-direction: column;
}

.dashboard-nav {
    background: var(--surface);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--surface-light);
}

.nav-brand h1 {
    font-size: 1.5rem;
}

.nav-logo {
    height: 50px;
    width: auto;
    display: block;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: flex-start;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.nav-link i {
    width: 18px;
    height: 18px;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

/* User Profile Dropdown */
.user-profile-menu {
    position: relative;
}

.user-profile-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.user-profile-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.chevron-icon {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

.user-dropdown.show + .user-profile-toggle .chevron-icon {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--surface);
    border: 1px solid var(--surface-light);
    border-radius: 8px;
    min-width: 250px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 1000;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

.dropdown-item i {
    width: 18px;
    height: 18px;
}

.dropdown-section {
    padding: 12px 16px;
}

.dropdown-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 600;
}

.dropdown-divider {
    height: 1px;
    background-color: var(--surface-light);
    margin: 8px 0;
}

.user-dropdown .guild-selector select {
    width: 100%;
    padding: 8px 12px;
    background: var(--background);
    border: 1px solid var(--surface-light);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.user-dropdown .guild-selector select:hover {
    border-color: var(--primary);
}

.user-dropdown .guild-selector select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.1);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.dashboard-main {
    flex: 1;
    max-width: 1800px;
    width: 100%;
    margin: 0 auto;
    padding: 30px;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 1fr 500px;
    gap: 30px;
    align-items: start;
}

.main-content {
    min-width: 0;
}

.sidebar-content {
    position: sticky;
    top: 30px;
    max-height: calc(100dvh - 120px); /* Dynamic viewport height for mobile */
    max-height: calc(100vh - 120px); /* Fallback for older browsers */
    overflow-y: auto;
}

/* Sidebar scrollbar */
.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: var(--surface);
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: var(--surface-light);
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 20px;
}

.dashboard-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Dashboard Tabs */
.dashboard-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--surface);
    padding-bottom: 0;
    background: #000;
}

.dashboard-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.dashboard-tab-btn:hover {
    color: var(--text-primary);
    background: var(--surface);
}

.dashboard-tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.dashboard-tab-btn i {
    width: 20px;
    height: 20px;
}

.dashboard-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.dashboard-tab-content.active {
    display: block;
}

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

.guild-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-wrapped {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    animation: pulse-glow 2s ease-in-out infinite;
}

.btn-wrapped:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
    }
    50% {
        box-shadow: 0 0 30px rgba(118, 75, 162, 0.8);
    }
}

.guild-selector select {
    padding: 10px 15px;
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--surface-light);
    border-radius: var(--border-radius);
    font-size: 1rem;
    cursor: pointer;
}

.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--surface-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--surface);
    padding: 25px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-info h3 {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: var(--surface);
    padding: 25px;
    border-radius: var(--border-radius);
}

.chart-card h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

.recent-games {
    background: var(--surface);
    padding: 25px;
    border-radius: var(--border-radius);
}

.recent-games h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* Game history list with infinite scroll */
.games-list-scroll {
    max-height: 600px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 10px;
}

/* Game history list with page scroll */
.games-list-page-scroll {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 40px;
}

/* Custom scrollbar */
.games-list-scroll::-webkit-scrollbar {
    width: 8px;
}

.games-list-scroll::-webkit-scrollbar-track {
    background: var(--surface-light);
    border-radius: 4px;
}

.games-list-scroll::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.games-list-scroll::-webkit-scrollbar-thumb:hover {
    background: #4752c4;
}

/* New game history card layout */
.game-history-card {
    background: var(--surface-light);
    padding: 16px 20px;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    cursor: pointer;
}

.game-history-card > div:first-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.game-history-card:hover {
    background: #3a3a3a;
    border-left-color: var(--primary-color);
    transform: translateX(5px);
}

.game-history-card.expanded {
    background: #3a3a3a;
    border-left-color: var(--primary-color);
}

.game-expand-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideDown 0.3s ease;
}

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

.distribution-loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
    font-size: 0.9rem;
}

.distribution-chart {
    max-height: 300px;
    width: 100%;
}

.game-word-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.game-word-title {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.game-date-small {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 400;
}

.game-score-badge {
    font-size: 1.4rem;
    font-weight: 700;
    padding: 8px 20px;
    border-radius: 6px;
    min-width: 70px;
    text-align: center;
}

/* Score-specific colors - green to red gradient (1=best, 6=worst) */
.game-score-badge.score-1 {
    background: rgba(34, 197, 94, 1);  /* Bright green - best score */
    color: white;
}

.game-score-badge.score-2 {
    background: rgba(74, 222, 128, 1);  /* Medium green - good score */
    color: white;
}

.game-score-badge.score-3 {
    background: rgba(134, 239, 172, 1);  /* Light green - still good */
    color: white;
}

.game-score-badge.score-4 {
    background: rgba(251, 191, 36, 1);  /* Yellow/orange - warning */
    color: white;
}

.game-score-badge.score-5 {
    background: rgba(249, 115, 22, 1);  /* Orange - poor */
    color: white;
}

.game-score-badge.score-6 {
    background: rgba(239, 68, 68, 1);  /* Red - bad */
    color: white;
}

.game-score-badge.score-7 {
    background: rgba(158, 158, 158, 1);  /* Gray for failed */
    color: white;
}

/* Loading more indicator */
.loading-more {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
}

.spinner-small {
    width: 30px;
    height: 30px;
    border: 3px solid var(--surface-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

/* Old game card styles (keep for backwards compatibility) */
.games-list {
    display: grid;
    gap: 15px;
}

.game-card {
    background: var(--surface-light);
    padding: 15px 20px;
    border-radius: var(--border-radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.game-score {
    font-size: 1.2rem;
    font-weight: 700;
    padding: 5px 15px;
    border-radius: 5px;
}

.game-score.excellent {
    background: var(--success);
    color: white;
}

.game-score.good {
    background: var(--primary-color);
    color: white;
}

.game-score.okay {
    background: var(--warning);
    color: white;
}

.game-score.failed {
    background: var(--danger);
    color: white;
}

.game-word {
    color: var(--text-primary);
    font-weight: 600;
    text-transform: uppercase;
}

.no-data {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

footer {
    border-top: 1px solid var(--surface-light);
    padding: 60px 20px 30px;
    color: var(--text-secondary);
    position: relative;
    overflow: hidden;
}

.discord-bg-effect-footer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 15px;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.discord-logo-row-footer {
    display: flex;
    gap: 32px;
    justify-content: center;
}

.discord-logo-row-footer:nth-child(even) {
    transform: translateX(16px);
}

.discord-logo-bg-footer {
    width: 24px;
    height: 24px;
    color: rgba(88, 101, 242, 0.04);
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    position: relative;
    z-index: 1;
}

.footer-section h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.footer-section h4 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.footer-description {
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.footer-copyright {
    color: var(--text-secondary);
    font-size: 0.9rem;
    opacity: 0.7;
}

.footer-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links-list li {
    margin-bottom: 12px;
}

.footer-links-list a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-links-list a:hover {
    color: var(--primary-color);
}

.footer-links-list a i {
    width: 18px;
    height: 18px;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer-section {
        text-align: center;
    }

    .footer-links-list a {
        justify-content: center;
    }
}

/* Policy Pages Styles */
.policy-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.policy-content h1 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 2.5rem;
}

.policy-content .last-updated {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.policy-content section {
    margin-bottom: 30px;
}

.policy-content h2 {
    color: var(--text-primary);
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.8rem;
    border-bottom: 2px solid var(--surface-light);
    padding-bottom: 10px;
}

.policy-content h3 {
    color: var(--text-primary);
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.policy-content p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 15px;
}

.policy-content ul {
    margin-left: 30px;
    margin-bottom: 15px;
}

.policy-content ul li {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 8px;
}

.policy-content a {
    color: var(--primary-color);
    text-decoration: none;
}

.policy-content a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.policy-content strong {
    color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

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

    .dashboard-nav {
        padding: 10px 15px;
    }

    .nav-logo {
        height: 40px;
    }

    .nav-menu {
        gap: 5px;
    }

    .nav-link {
        padding: 8px 12px;
        font-size: 0;
        gap: 0;
    }

    .nav-link i {
        width: 20px;
        height: 20px;
    }

    .user-profile-toggle span {
        display: none;
    }

    .avatar {
        width: 35px;
        height: 35px;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-controls {
        flex-wrap: nowrap;
        gap: 10px;
        width: 100%;
    }

    .btn-wrapped {
        padding: 8px 12px;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .btn-wrapped i {
        width: 16px;
        height: 16px;
    }

    .guild-selector {
        flex: 1;
    }

    .game-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .game-history-card {
        padding: 12px 16px;
    }

    .game-word-title {
        font-size: 1.1rem;
    }

    .game-score-badge {
        font-size: 1.2rem;
        padding: 6px 16px;
        min-width: 60px;
    }

    .games-list-scroll {
        max-height: 500px;
    }

    /* Hero Showcase Responsive */
    .hero-title {
        font-size: 2rem;
    }

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

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

    .hero-avatar {
        width: 60px;
        height: 60px;
    }

    .hero-cta h2 {
        font-size: 1.5rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .btn-with-description {
        width: 100%;
        justify-content: flex-start;
    }

    .btn-step {
        padding-left: 50px;
    }

    .step-number {
        left: -8px;
        top: -8px;
        min-width: 55px;
        height: 24px;
        border-radius: 12px;
        font-size: 0.65rem;
        padding: 0 8px;
    }

    .btn-large {
        padding: 12px 20px;
        font-size: 1rem;
    }

    .btn-main-text {
        font-size: 0.95rem;
    }

    .btn-sub-text {
        font-size: 0.7rem;
    }

    .showcase-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .hero-showcase {
        padding: 30px 15px 40px;
    }

    .hero-content {
        margin-bottom: 40px;
    }

    .showcase-caption h3 {
        font-size: 1.2rem;
    }

    .showcase-caption {
        padding: 20px;
    }

    .how-it-works {
        padding: 40px 20px;
    }

    .how-it-works h2 {
        font-size: 2rem;
    }

    .steps-container {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .step:nth-child(1),
    .step:nth-child(2),
    .step:nth-child(3),
    .step:nth-child(4) {
        grid-column: auto;
    }

    .cta-box-inline {
        grid-column: auto;
    }

    .step {
        padding: 35px 25px;
    }

    .step-icon {
        width: 70px;
        height: 70px;
    }

    .step-icon i {
        width: 35px;
        height: 35px;
    }

    .step-number-badge {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }

    .step h3 {
        font-size: 1.15rem;
    }

    .step p {
        font-size: 0.9rem;
    }

    .cta-box-inline {
        padding: 30px 20px;
    }

    .cta-box-inline .btn {
        font-size: 1rem;
        padding: 14px 24px;
    }
}

/* Leaderboard Section */
.leaderboard-section {
    background: var(--surface);
    padding: 16px;
    border-radius: var(--border-radius);
}

.leaderboard-header {
    margin-bottom: 16px;
}

.leaderboard-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.leaderboard-header h2 i {
    color: var(--secondary-color);
}

.leaderboard-filters {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.button-group {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 6px 10px;
    background: var(--surface-light);
    color: var(--text-primary);
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    flex: 1;
    justify-content: center;
}

.filter-btn:hover {
    background: #3a3a3a;
    border-color: var(--primary-color);
}

.filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.filter-btn i {
    width: 12px;
    height: 12px;
}

/* Leaderboard Tabs */
.leaderboard-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--surface-light);
    padding-bottom: 0;
}

.tab-btn {
    padding: 8px 16px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(88, 101, 242, 0.1);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-btn i {
    width: 14px;
    height: 14px;
}

/* Info Tooltip */
.info-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
}

.info-icon {
    width: 14px;
    height: 14px;
    color: var(--text-secondary);
    cursor: help;
    transition: color 0.2s ease;
}

.info-tooltip:hover .info-icon {
    color: var(--primary-color);
}

.tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 50%;
    left: calc(100% + 10px);
    transform: translateY(-50%);
    background-color: var(--surface);
    color: var(--text-primary);
    text-align: left;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 400;
    white-space: nowrap;
    z-index: 1000;
    border: 1px solid var(--surface-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    min-width: 250px;
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 100%;
    transform: translateY(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent var(--surface) transparent transparent;
}

.info-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Leaderboard Content */
.leaderboard-content {
    display: none;
}

.leaderboard-content.active {
    display: block;
}

.leaderboard-table {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.leaderboard-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.leaderboard-header-row {
    display: grid;
    grid-template-columns: 50px 1fr 120px 120px;
    padding: 8px 12px;
    background: var(--surface-light);
    border-radius: var(--border-radius);
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-secondary);
}

.leaderboard-row {
    display: grid;
    grid-template-columns: 50px 1fr 120px 120px;
    padding: 10px 12px;
    background: var(--surface-light);
    border-radius: var(--border-radius);
    align-items: center;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.leaderboard-row:hover {
    background: #3a3a3a;
    border-left-color: var(--primary-color);
    transform: translateX(5px);
}

.leaderboard-row.current-user,
.leaderboard-row.current-server {
    background: rgba(88, 101, 242, 0.15);
    border-left-color: var(--secondary-color);
    box-shadow: 0 0 20px rgba(87, 242, 135, 0.15);
}

.leaderboard-row.current-user:hover,
.leaderboard-row.current-server:hover {
    background: rgba(88, 101, 242, 0.25);
    border-left-color: var(--secondary-color);
}

/* Column Styles */
.rank-col,
.player-col,
.server-col,
.games-col,
.avg-col,
.streak-col,
.members-col {
    display: flex;
    align-items: center;
}

.rank-col {
    justify-content: center;
}

.games-col,
.avg-col,
.streak-col,
.members-col {
    justify-content: center;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.8rem;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
}

.rank-badge.rank-1 {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    font-size: 1rem;
}

.rank-badge.rank-2 {
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
    color: #000;
    box-shadow: 0 0 12px rgba(192, 192, 192, 0.4);
    font-size: 0.95rem;
}

.rank-badge.rank-3 {
    background: linear-gradient(135deg, #cd7f32, #e8a87c);
    color: #000;
    box-shadow: 0 0 12px rgba(205, 127, 50, 0.4);
    font-size: 0.95rem;
}

.rank-badge.rank-default {
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.player-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.player-name {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.85rem;
}

a.player-name {
    text-decoration: none;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

a.player-name:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.player-server {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.server-name {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.85rem;
}

/* Server Leaderboard Grid */
#servers-leaderboard .leaderboard-header-row {
    grid-template-columns: 50px 1fr 100px 80px 80px;
}

#servers-leaderboard .leaderboard-row {
    grid-template-columns: 50px 1fr 100px 80px 80px;
}

/* Server Row Expandable Styles */
.server-row-clickable {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.server-row-clickable:hover {
    background-color: rgba(88, 101, 242, 0.1);
}

.server-row-clickable.expanded {
    background-color: rgba(88, 101, 242, 0.15);
    border-bottom: none;
}

.server-col {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.expand-icon {
    font-size: 0.8rem;
    margin-left: 8px;
    transition: transform 0.3s ease;
    color: #5865F2;
}

.server-details-container {
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.05) 0%, rgba(88, 101, 242, 0.05) 100%);
    border-top: 1px solid rgba(88, 101, 242, 0.2);
    padding: 20px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
        padding-top: 20px;
        padding-bottom: 20px;
    }
}

.loading-spinner {
    text-align: center;
    padding: 20px;
    color: #6b7280;
    font-size: 0.9rem;
}

.error-message {
    text-align: center;
    padding: 20px;
    color: #ef4444;
    font-size: 0.9rem;
}

.server-details-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Server Stats Section */
.server-stats-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.08) 0%, rgba(88, 101, 242, 0.05) 100%);
    border: 1px solid rgba(88, 101, 242, 0.25);
    border-radius: 16px;
    padding: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(88, 101, 242, 0.15);
    border-color: rgba(88, 101, 242, 0.4);
}

.stat-card .stat-value {
    font-size: 2rem;
    color: #ffffff;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: #9ca3af;
    margin: 0 0 16px 0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Meta information - horizontal inline */
.stat-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    width: 100%;
}

.meta-item {
    display: flex;
    gap: 8px;
    align-items: baseline;
}

.meta-value {
    font-size: 1rem;
    color: #5865F2;
    font-weight: 700;
}

.meta-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.percentile-highlight .meta-value {
    color: #57F287;
}

.word-value {
    font-family: 'Courier New', monospace;
    letter-spacing: 4px;
    font-size: 2rem;
    text-shadow: 0 2px 8px rgba(88, 101, 242, 0.3);
}

.top-player-card .stat-value.player-name {
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s ease;
}

.top-player-card .stat-value.player-name:hover {
    color: #5865F2;
    text-decoration: underline;
}

/* Server User Leaderboard */
.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(88, 101, 242, 0.2);
}

.section-icon {
    width: 22px;
    height: 22px;
    color: #5865F2;
    flex-shrink: 0;
}

.section-header h4 {
    font-size: 1.15rem;
    color: #e5e7eb;
    margin: 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.server-users-section h4 {
    font-size: 1.1rem;
    color: #e5e7eb;
    margin-bottom: 15px;
    font-weight: 600;
}

.server-user-leaderboard {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    overflow: hidden;
}

.user-leaderboard-header {
    display: grid;
    grid-template-columns: 80px 1fr 80px 90px 100px;
    padding: 12px 15px;
    background: rgba(88, 101, 242, 0.1);
    font-weight: 600;
    font-size: 0.85rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-leaderboard-row {
    display: grid;
    grid-template-columns: 80px 1fr 80px 90px 100px;
    padding: 12px 15px;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.2s ease;
}

.user-leaderboard-row:hover {
    background-color: rgba(88, 101, 242, 0.08);
}

.user-leaderboard-row:last-child {
    border-bottom: none;
}

.user-rank-col {
    display: flex;
    justify-content: center;
}

.user-name-col {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-name-col .player-name {
    color: #5865F2;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.user-name-col .player-name:hover {
    color: #7983f5;
    text-decoration: underline;
}

.rank-medal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.rank-medal.gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #1f2937;
    box-shadow: 0 2px 12px rgba(255, 215, 0, 0.4);
}

.rank-medal.silver {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    color: #1f2937;
    box-shadow: 0 2px 12px rgba(192, 192, 192, 0.4);
}

.rank-medal.bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #d4a574 100%);
    color: #1f2937;
    box-shadow: 0 2px 12px rgba(205, 127, 50, 0.4);
}

.global-rank-badge {
    background: rgba(88, 101, 242, 0.15);
    border: 1px solid rgba(88, 101, 242, 0.3);
    border-radius: 6px;
    padding: 4px 10px;
    color: #5865F2;
    font-weight: 600;
    font-size: 0.85rem;
}

.user-games-col,
.user-avg-col,
.user-streak-col,
.user-global-col {
    text-align: center;
    font-size: 0.9rem;
}

/* Responsive Server Details */
@media (max-width: 968px) {
    .server-stats-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .server-stats-section {
        gap: 16px;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-card .stat-value {
        font-size: 1.75rem;
    }

    .word-value {
        font-size: 1.75rem;
        letter-spacing: 3px;
    }

    .stat-meta {
        gap: 16px;
    }

    .meta-value {
        font-size: 0.95rem;
    }

    .meta-label {
        font-size: 0.7rem;
    }

    .user-leaderboard-header,
    .user-leaderboard-row {
        grid-template-columns: 70px 1fr 70px 80px 90px;
        padding: 10px 12px;
        font-size: 0.8rem;
    }

    .global-rank-badge {
        padding: 3px 8px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .stat-card .stat-value {
        font-size: 1.5rem;
    }

    .word-value {
        font-size: 1.5rem;
        letter-spacing: 2px;
    }

    .stat-meta {
        gap: 12px;
        flex-direction: column;
    }

    .meta-item {
        justify-content: space-between;
        width: 100%;
    }

    .user-leaderboard-header {
        display: none;
    }

    .user-leaderboard-row {
        grid-template-columns: 50px 1fr 90px;
        gap: 10px;
    }

    .user-games-col,
    .user-avg-col {
        display: none;
    }

    .section-icon {
        width: 18px;
        height: 18px;
    }

    .section-header h4 {
        font-size: 1rem;
    }
}

/* Responsive Leaderboard */
@media (max-width: 1200px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .sidebar-content {
        position: static;
        max-height: none;
    }

    .leaderboard-section {
        padding: 30px;
    }

    .leaderboard-header h2 {
        font-size: 1.8rem;
        margin-bottom: 25px;
    }

    .leaderboard-filters {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 30px;
    }

    .filter-group label {
        font-size: 0.9rem;
    }

    .filter-btn {
        padding: 10px 18px;
        font-size: 0.9rem;
        flex: initial;
    }

    .filter-btn i {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 968px) {
    /* Top navigation responsive */
    .dashboard-nav {
        padding: 12px 20px;
    }

    .nav-logo {
        height: 40px;
    }

    .nav-user {
        gap: 10px;
    }

    .nav-user .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        margin: 5px;
    }

    .nav-user .btn i {
        width: 16px;
        height: 16px;
    }

    /* Dashboard navigation responsive */
    .dashboard-tab-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
        gap: 6px;
    }

    .dashboard-tab-btn i {
        width: 18px;
        height: 18px;
    }

    .dashboard-tabs {
        gap: 6px;
    }

    .leaderboard-filters {
        flex-direction: column;
        gap: 20px;
    }

    .leaderboard-header-row {
        grid-template-columns: 60px 1fr 120px 120px;
        padding: 12px 15px;
        font-size: 0.75rem;
    }

    .leaderboard-row {
        grid-template-columns: 60px 1fr 120px 120px;
        padding: 12px 15px;
    }

    #servers-leaderboard .leaderboard-header-row {
        grid-template-columns: 60px 1fr 100px 90px 90px;
    }

    #servers-leaderboard .leaderboard-row {
        grid-template-columns: 60px 1fr 100px 90px 90px;
    }

    .rank-badge {
        min-width: 35px;
        height: 35px;
        font-size: 0.95rem;
    }

    .rank-badge.rank-1 {
        font-size: 1.1rem;
    }

    .rank-badge.rank-2,
    .rank-badge.rank-3 {
        font-size: 1rem;
    }

    .player-name,
    .server-name {
        font-size: 0.9rem;
    }

    .player-server {
        font-size: 0.75rem;
    }

    .games-col,
    .avg-col,
    .streak-col,
    .members-col {
        font-size: 0.9rem;
    }
}

@media (max-width: 640px) {
    /* Ensure html and body allow fixed positioning */
    html, body {
        overflow-x: clip;
        position: relative;
        width: 100%;
        height: 100%;
    }

    /* Fix iOS Safari momentum scrolling issue with fixed elements */
    body {
        -webkit-overflow-scrolling: touch;
    }

    .dashboard-container {
        position: relative;
        min-height: 100vh;
        padding-bottom: 80px; /* Space for fixed navigation */
    }

    .dashboard-main {
        padding-bottom: 80px; /* Extra padding to prevent content being hidden behind nav */
    }

    /* Top navigation mobile styles */
    .dashboard-nav {
        padding: 10px 12px;
    }

    .nav-logo {
        height: 35px;
    }

    .nav-user {
        gap: 6px;
    }

    .nav-user .btn {
        padding: 8px 12px;
        font-size: 0.75rem;
        margin: 3px;
        gap: 6px;
    }

    .nav-user .btn i {
        width: 14px;
        height: 14px;
    }

    .leaderboard-section {
        padding: 20px 15px;
    }

    .leaderboard-header h2 {
        font-size: 1.4rem;
    }

    .button-group {
        width: 100%;
    }

    .filter-btn {
        flex: 1;
        justify-content: center;
        padding: 8px 6px;
        font-size: 0.7rem;
        min-width: 0;
        white-space: nowrap;
    }

    .filter-btn i {
        width: 12px;
        height: 12px;
    }

    .tab-btn {
        flex: 1;
        justify-content: center;
        padding: 10px 4px;
        font-size: 0.75rem;
        gap: 4px;
        min-width: 0;
        white-space: nowrap;
    }

    .tab-btn i {
        width: 12px;
        height: 12px;
    }

    .leaderboard-tabs {
        gap: 4px;
    }

    .button-group {
        gap: 4px;
    }

    /* Mobile bottom navigation bar */
    .dashboard-tabs {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100%;
        margin: 0;
        background: #000;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        display: flex;
        justify-content: space-around;
        padding: 8px 0;
        padding-bottom: calc(8px + constant(safe-area-inset-bottom)); /* iOS 11.0 */
        padding-bottom: calc(8px + env(safe-area-inset-bottom)); /* iOS 11.2+ */
        z-index: 9999 !important;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
        transform: translate3d(0, 0, 0); /* Force GPU acceleration */
        -webkit-transform: translate3d(0, 0, 0);
        will-change: transform;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }

    .dashboard-tab-btn {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 6px 12px;
        gap: 4px;
        min-width: auto;
        flex: 1;
        font-size: 0.65rem;
        border-radius: 8px;
    }

    .dashboard-tab-btn i {
        width: 22px;
        height: 22px;
        margin-bottom: 2px;
    }

    /* Show small text below icons on mobile */
    .dashboard-tab-btn span {
        display: block;
        font-size: 0.65rem;
        line-height: 1;
    }

    /* Position compare button in normal flow, separate from bottom nav */
    .compare-container {
        width: 100%;
        padding: 0 16px;
        margin: 12px 0;
        background: transparent;
        display: flex;
        justify-content: flex-end;
    }

    .compare-toggle-btn {
        width: auto;
        background: var(--bg-secondary);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        padding: 12px 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        font-size: 0.9rem;
        flex-direction: row-reverse;
    }

    .compare-toggle-btn i {
        width: 20px;
        height: 20px;
    }

    /* Add padding to main content to account for fixed bottom nav */
    .dashboard-main {
        padding-bottom: 80px;
    }

    /* Hide stat icons on mobile */
    .stat-icon {
        display: none;
    }

    /* Ensure leaderboard section doesn't overflow */
    .leaderboard-section {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        padding: 0 16px;
        box-sizing: border-box;
    }

    .leaderboard-table {
        width: 100%;
        max-width: 100%;
    }

    .leaderboard-header-row {
        grid-template-columns: 40px 1fr 55px 60px;
        padding: 8px 8px;
        font-size: 0.65rem;
        gap: 6px;
    }

    .leaderboard-row {
        grid-template-columns: 40px 1fr 55px 60px;
        padding: 8px 8px;
        gap: 6px;
        font-size: 0.85rem;
    }

    /* Hide streak column on mobile for players */
    #players-leaderboard .leaderboard-header-row .streak-col,
    #players-leaderboard .leaderboard-row .streak-col {
        display: none;
    }

    /* Hide active players column on mobile for servers, show avg score instead */
    #servers-leaderboard .leaderboard-header-row {
        grid-template-columns: 40px 1fr 65px 60px;
    }

    #servers-leaderboard .leaderboard-row {
        grid-template-columns: 40px 1fr 65px 60px;
    }

    #servers-leaderboard .leaderboard-header-row .members-col,
    #servers-leaderboard .leaderboard-row .members-col {
        display: none;
    }

    /* Ensure text doesn't overflow in columns */
    .player-col, .server-col {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .games-col, .avg-col, .members-col {
        text-align: right;
        font-size: 0.85rem;
    }

    .rank-badge {
        min-width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }

    .rank-badge.rank-1 {
        font-size: 1rem;
    }

    .rank-badge.rank-2,
    .rank-badge.rank-3 {
        font-size: 0.9rem;
    }

    .player-name,
    .server-name {
        font-size: 0.85rem;
    }

    .player-server {
        font-size: 0.7rem;
    }
}

/* Extra small screens (iPhone SE, small phones) */
@media (max-width: 390px) {
    /* Top navigation for very small screens */
    .dashboard-nav {
        padding: 8px 10px;
    }

    .nav-logo {
        height: 30px;
    }

    .nav-user {
        gap: 4px;
    }

    .nav-user .btn {
        padding: 6px 10px;
        font-size: 0.7rem;
        margin: 2px;
        gap: 4px;
    }

    .nav-user .btn i {
        width: 12px;
        height: 12px;
    }

    /* Dashboard navigation for very small screens */
    .dashboard-tab-btn {
        padding: 8px 10px;
        font-size: 0.75rem;
        gap: 4px;
    }

    .dashboard-tab-btn i {
        width: 16px;
        height: 16px;
    }

    .dashboard-tabs {
        gap: 4px;
    }

    .filter-btn {
        padding: 6px 4px;
        font-size: 0.65rem;
        gap: 3px;
    }

    .filter-btn i {
        width: 10px;
        height: 10px;
    }

    .tab-btn {
        padding: 8px 2px;
        font-size: 0.7rem;
        gap: 2px;
    }

    .tab-btn i {
        width: 10px;
        height: 10px;
    }

    .leaderboard-tabs {
        gap: 2px;
    }

    .button-group {
        gap: 2px;
    }

    .leaderboard-header h2 {
        font-size: 1.2rem;
    }
}

/* User Stats Modal */
.modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity 0.3s ease;
    align-items: center;
    justify-content: center;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 0;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal.show .modal-content {
    transform: scale(1);
}

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

.modal-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 4px;
}

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

.match-history-container {
    margin-top: 24px;
}

.match-history-container h3 {
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 1.2rem;
}

.games-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.game-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    transition: background 0.2s ease;
}

.game-item:hover {
    background: var(--bg-primary);
}

.game-date {
    color: var(--text-secondary);
    font-size: 0.85rem;
    min-width: 100px;
}

.game-word {
    color: var(--text-primary);
    font-weight: 600;
    flex: 1;
    text-align: center;
}

.game-score {
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 6px;
    min-width: 50px;
    text-align: center;
}

.game-score.score-1 {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000;
}

.game-score.score-2 {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: #000;
}

.game-score.score-3 {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    color: #fff;
}

.game-score.score-4-5 {
    background: linear-gradient(135deg, #fb923c, #f97316);
    color: #fff;
}

.game-score.score-fail {
    background: linear-gradient(135deg, #f87171, #ef4444);
    color: #fff;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .game-item {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .game-date {
        min-width: auto;
    }
}

/* Dashboard Tabs Row with Compare Button */
/* Compare Container - Animates from button to search */
.compare-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.compare-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-direction: row-reverse;
}

.compare-toggle-btn:hover {
    color: var(--text-primary);
    border-bottom-color: var(--primary-color);
}

.compare-toggle-btn i {
    width: 18px;
    height: 18px;
}

/* Hide button when search is active */
.compare-container.search-active .compare-toggle-btn {
    opacity: 0;
    pointer-events: none;
    position: absolute;
}

/* Search Box - Starts hidden, expands when button is clicked */
.compare-search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface-light);
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    width: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.compare-container.search-active .compare-search-box {
    width: 300px;
    opacity: 1;
    pointer-events: all;
}

.compare-search-box i {
    color: var(--text-secondary);
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

#compact-user-search {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    min-width: 0;
}

#compact-user-search::placeholder {
    color: var(--text-secondary);
}

.close-search-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.close-search-btn:hover {
    background: var(--surface);
    color: var(--text-primary);
}

.close-search-btn i {
    width: 18px;
    height: 18px;
}

/* Search Results Dropdown */
.compact-search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: var(--surface-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.compact-search-result-item {
    padding: 1rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s ease;
}

.compact-search-result-item:last-child {
    border-bottom: none;
}

.compact-search-result-item:hover {
    background: var(--surface);
}

/* Comparison Container */
.comparison-container {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
}

.comparison-section h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.search-container {
    position: relative;
    margin-bottom: 1.5rem;
}

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

.search-input-wrapper i {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
    width: 20px;
    height: 20px;
}

#user-search {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    background: var(--surface-light);
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

#user-search:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--surface);
}

.search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--surface-light);
    border-radius: var(--border-radius);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.search-result-item {
    padding: 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--surface-light);
    transition: background 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--surface-light);
}

.search-result-name {
    font-weight: 500;
    color: var(--text-primary);
}

.search-result-stats {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.search-no-results {
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
}

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

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

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

.comparison-card {
    background: var(--surface-light);
    border-radius: var(--border-radius);
    padding: 1.5rem;
}

.comparison-card h5 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
    font-size: 1.125rem;
}

.comparison-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comparison-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--surface);
    border-radius: 6px;
}

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

.comparison-stat .stat-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.125rem;
}

/* Stat highlighting */
.stat-better {
    color: #57F287;
    font-weight: 600;
}

.stat-worse {
    color: #ef4444;
    opacity: 0.7;
}

/* Comparison Stats Styling */
.stat-comparison {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-separator {
    color: var(--text-secondary);
    font-weight: 400;
}

.user-stat {
    color: #3b82f6;
}

.compare-stat {
    color: #fb923c;
}

.stat-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    gap: 0.5rem;
}

.user-label {
    color: #3b82f6;
    font-weight: 600;
}

.compare-label {
    color: #fb923c;
    font-weight: 600;
    margin-left: auto;
}

/* Comparison Header */
#comparison-header,
#word-history-comparison-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    background: var(--surface-light);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    border-left: 3px solid #fb923c;
}

#comparison-header h4,
#word-history-comparison-header h4 {
    margin: 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.clear-comparison-btn {
    background: var(--danger);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.clear-comparison-btn:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.clear-comparison-btn i {
    width: 16px;
    height: 16px;
}

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

    .stat-labels {
        font-size: 0.7rem;
    }

    #comparison-header,
    #word-history-comparison-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* Word History Single View */
.games-list-single {
    width: 100%;
}

/* Word History Comparison View with Centered Layout */
.games-list-comparison {
    width: 100%;
}

/* Word History comparison controls */
.word-history-comparison-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.comparison-user-info {
    font-size: 1rem;
    display: flex;
    align-items: center;
}

.comparison-actions {
    display: flex;
    gap: 0.75rem;
}

.search-comparison-btn,
.clear-comparison-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-comparison-btn {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.search-comparison-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5);
}

.clear-comparison-btn {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.clear-comparison-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.5);
}

.comparison-header {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    align-items: center;
}

.comparison-user-label {
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
}

.comparison-center-label {
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

.comparison-row {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    align-items: center;
    transition: background 0.2s ease;
}

.comparison-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.comparison-score-left,
.comparison-score-right {
    display: flex;
    justify-content: center;
    align-items: center;
}

.comparison-word-center {
    text-align: center;
}

.comparison-word-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.comparison-date {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Empty score badge for missing games */
.game-score-badge.empty-score {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.2);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    opacity: 0.5;
}

/* Responsive comparison view */
@media (max-width: 768px) {
    .comparison-header,
    .comparison-row {
        grid-template-columns: 80px 1fr 80px;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .comparison-user-label,
    .comparison-center-label {
        font-size: 0.9rem;
    }

    .comparison-word-title {
        font-size: 1rem;
    }

    .comparison-date {
        font-size: 0.75rem;
    }

    .word-history-comparison-controls {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .comparison-user-info {
        font-size: 0.9rem;
    }

    .comparison-actions {
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
    }

    .search-comparison-btn,
    .clear-comparison-btn {
        width: 100%;
        justify-content: center;
        padding: 0.6rem 1rem;
    }
}

/* ========================================
   GOOGLE ADSENSE AD LAYOUT
   ======================================== */

/* 3-Column Grid Layout: Ad | Content | Ad */
.dashboard-with-ads {
    display: grid !important;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Ad Sidebar Styling */
.ad-sidebar {
    position: sticky;
    top: 80px;
    min-height: 600px;
    width: 160px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

/* Hide ad sidebars when empty (before ads load) */
.ad-sidebar:empty {
    display: none !important;
    width: 0;
}

/* Reset dashboard-main to work with grid - remove conflicting styles */
.dashboard-with-ads .dashboard-main {
    min-width: 0;
    max-width: none;
    margin: 0;
}

/* Revert to original layout when ads don't load */
.dashboard-with-ads.no-ads {
    display: block !important;
}

.dashboard-with-ads.no-ads .ad-sidebar {
    display: none !important;
}

.dashboard-with-ads.no-ads .dashboard-main {
    max-width: 1800px;
    margin: 0 auto;
    padding: 30px;
}

/* Desktop: 1200px and above - Show sidebar ads */
@media (min-width: 1200px) {
    .ad-sidebar {
        display: flex;
    }
}

/* Tablet: 768px to 1199px - Hide sidebar ads */
@media (max-width: 1199px) {
    .dashboard-with-ads {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .ad-sidebar {
        display: none;
    }
}

/* Mobile: Below 768px - Hide sidebar ads */
@media (max-width: 767px) {
    .dashboard-with-ads {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .ad-sidebar {
        display: none;
    }
}

/* User count badge in Players tab */
.tab-btn .user-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    padding: 4px 10px;
    background: rgba(79, 70, 229, 0.15);
    border: 1px solid rgba(79, 70, 229, 0.3);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: #a5b4fc;
}

.tab-btn.active .user-count-badge {
    background: rgba(79, 70, 229, 0.2);
    border-color: rgba(79, 70, 229, 0.4);
}

.user-count-badge .info-tooltip {
    margin-left: 2px;
}

.user-count-badge #qualified-count {
    color: #5865F2;
    font-weight: 600;
}

.user-count-badge #total-count {
    color: #a5b4fc;
    font-weight: 600;
}
