@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --secondary-color: #8b5cf6;
    --accent-color: #06b6d4;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    
    /* Light mode */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --card-bg: #ffffff;
    --card-hover: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    
    --gold: #eab308;
    --silver: #94a3b8;
    --bronze: #ea580c;
}

body.dark-mode {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --card-bg: #1e293b;
    --card-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Improve tap targets for mobile */
@media (hover: none) and (pointer: coarse) {
    button, a, input, select, textarea {
        min-height: 44px;
    }
}

/* Navbar */
.navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    height: 70px;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease;
}

.nav-brand:hover {
    transform: scale(1.02);
}

.nav-brand span {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 8px;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    padding: 8px 16px;
    border-radius: 8px;
}

.nav-links a:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-links a.active {
    color: var(--primary-color);
    background: rgba(79, 70, 229, 0.1);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
    border-radius: 2px;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: 60px;
        right: -100%;
        width: 250px;
        height: calc(100vh - 60px);
        background: var(--card-bg);
        flex-direction: column;
        padding: 20px;
        gap: 8px;
        border-left: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
        transition: right 0.3s ease;
        z-index: 999;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links a {
        width: 100%;
        padding: 12px 16px;
        border-radius: 8px;
    }
    
    .nav-links li {
        width: 100%;
    }
    
    .theme-toggle {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
    
    /* Hamburger animation */
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(7px, 7px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
}

/* Dark Mode Toggle */
.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
    margin-left: 16px;
}

.theme-toggle:hover {
    background: var(--card-hover);
    transform: scale(1.05);
}

.theme-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.theme-icon.sun {
    display: none;
}

body.dark-mode .theme-icon.sun {
    display: flex;
}

body.dark-mode .theme-icon.moon {
    display: none;
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0 12px;
        height: 60px;
    }
    
    .nav-links {
        gap: 2px;
    }
    
    .nav-links a {
        font-size: 0.8rem;
        padding: 6px 8px;
    }
    
    .nav-brand {
        font-size: 1.1rem;
    }
    
    .theme-toggle {
        margin-left: 8px;
        padding: 6px;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.championship-header {
    text-align: center;
    padding: 100px 20px 60px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    position: relative;
    overflow: hidden;
    margin-bottom: 64px;
}

.championship-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(79, 70, 229, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.championship-header h1 {
    font-size: 3.5rem;
    margin-bottom: 16px;
    font-weight: 700;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.tagline {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-weight: 400;
    position: relative;
}

.season-info {
    display: flex;
    justify-content: center;
    gap: 32px;
    font-size: 0.95rem;
    margin-top: 24px;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
}

.season-info span {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: var(--card-bg);
    border-radius: 50px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.separator {
    opacity: 0.3;
}

/* Active Tournament */
.active-tournament {
    margin-bottom: 40px;
}

.tournament-card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tournament-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tournament-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

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

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

.tournament-header h2 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.live-badge {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    animation: pulse-badge 2s infinite;
}

.format-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

@keyframes pulse-badge {
    0%, 100% { box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3); }
    50% { box-shadow: 0 4px 16px rgba(16, 185, 129, 0.5); }
}

.tournament-card h3 {
    font-size: 2rem;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.tournament-time {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.join-button {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 14px 40px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    position: relative;
    overflow: hidden;
}

.join-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.join-button:hover::before {
    left: 100%;
}

.join-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4);
}

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

.join-button.disabled {
    background: var(--text-muted);
    pointer-events: none;
    opacity: 0.5;
    box-shadow: none;
    cursor: not-allowed;
}

/* Upcoming Tournaments */
.upcoming-section {
    margin-bottom: 40px;
}

.upcoming-section h2 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.upcoming-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.upcoming-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.upcoming-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

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

.upcoming-card:hover::before {
    transform: scaleY(1);
}

.upcoming-card h4 {
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 1.1rem;
    font-weight: 600;
}

.upcoming-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Leaderboard */
.leaderboard-section {
    margin-bottom: 40px;
}

.leaderboard-section h2 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.points-legend {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
}

.points-legend span {
    padding: 8px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.points-legend span:hover {
    background: var(--bg-tertiary);
    transform: translateY(-1px);
}

.leaderboard {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

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

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

th {
    padding: 18px 24px;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
}

tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

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

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

td {
    padding: 18px 24px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.pos-1 {
    background: linear-gradient(90deg, rgba(234, 179, 8, 0.1) 0%, transparent 100%);
    border-left: 4px solid var(--gold);
}

.pos-2 {
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.1) 0%, transparent 100%);
    border-left: 4px solid var(--silver);
}

.pos-3 {
    background: linear-gradient(90deg, rgba(234, 88, 12, 0.1) 0%, transparent 100%);
    border-left: 4px solid var(--bronze);
}

.medal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.875rem;
    margin-right: 8px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.pos-1 .medal {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
}

.pos-2 .medal {
    background: linear-gradient(135deg, #cbd5e1, #94a3b8);
    color: white;
}

.pos-3 .medal {
    background: linear-gradient(135deg, #fb923c, #ea580c);
    color: white;
}

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

.points-highlight {
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.15rem;
}

/* Info Cards */
.info-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.info-card {
    background: var(--card-bg);
    padding: 32px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.info-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.info-card h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.25rem;
    font-weight: 600;
}

.info-card ul {
    list-style: none;
    padding-left: 0;
}

.info-card li {
    padding: 10px 0;
    padding-left: 28px;
    position: relative;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.info-card li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: 600;
}

/* Sections */
.leaderboard-section h2,
.upcoming-section h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 28px;
    color: var(--text-primary);
    position: relative;
    padding-bottom: 12px;
}

.leaderboard-section h2::after,
.upcoming-section h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.info-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.upcoming-section,
.leaderboard-section,
.info-section {
    margin-bottom: 64px;
}

.active-tournament {
    margin-bottom: 64px;
}

/* Past Tournaments */
.history-section {
    margin-bottom: 64px;
}

.history-section h2 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.history-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.history-title {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.history-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.history-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.history-actions {
    display: flex;
    gap: 10px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: min(960px, 100%);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

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

.modal-header h3 { margin: 0; }

.modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
}

.modal-body {
    padding: 16px 20px 20px;
    overflow: auto;
}

.modal-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.modal-table table { width: 100%; border-collapse: collapse; }
.modal-table th, .modal-table td { padding: 12px 14px; border-bottom: 1px solid var(--border-color); }
.modal-table thead { background: var(--bg-tertiary); }
.modal-table th { color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; }

@media (max-width: 768px) {
    .history-grid { grid-template-columns: 1fr; }
    .modal-content { width: 100%; }
}

/* Footer */
footer {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    margin-top: 80px;
    background: var(--bg-secondary);
}

footer p {
    font-size: 0.9rem;
}

/* Utility Classes */
.no-data {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 16px 12px;
    }
    
    .championship-header {
        padding: 40px 16px 30px;
        margin-bottom: 24px;
    }
    
    .championship-header h1 {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    .tagline {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }
    
    .season-info {
        flex-direction: column;
        gap: 8px;
        font-size: 0.85rem;
    }
    
    .season-info span {
        padding: 6px 14px;
        font-size: 0.8rem;
    }
    
    .separator {
        display: none;
    }
    
    .active-tournament {
        margin-bottom: 24px;
    }
    
    .tournament-card {
        padding: 20px 16px;
        border-radius: 12px;
    }
    
    .tournament-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 16px;
    }
    
    .tournament-header h2 {
        font-size: 0.75rem;
    }
    
    .tournament-card h3 {
        font-size: 1.25rem;
        line-height: 1.3;
        margin-bottom: 8px;
    }
    
    .tournament-time {
        font-size: 0.875rem;
        margin-bottom: 16px;
    }
    
    .live-badge, .format-badge {
        font-size: 0.7rem;
        padding: 5px 10px;
    }
    
    /* Password section mobile */
    #passwordSection {
        margin: 12px 0 !important;
    }
    
    #revealBtn {
        width: 100%;
        padding: 10px 16px !important;
        font-size: 0.9rem;
    }
    
    #passwordDisplay {
        padding: 10px !important;
        font-size: 0.95rem !important;
        word-break: break-all;
    }
    
    .join-button {
        width: 100%;
        text-align: center;
        padding: 12px 20px;
        font-size: 0.95rem;
        border-radius: 10px;
    }
    
    .leaderboard {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 12px;
    }
    
    table {
        font-size: 0.8rem;
        min-width: 550px;
    }
    
    th, td {
        padding: 12px 10px;
    }
    
    th {
        font-size: 0.7rem;
        padding: 14px 10px;
    }
    
    th:first-child,
    td:first-child {
        padding-left: 12px;
    }
    
    .medal {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
        margin-right: 4px;
    }
    
    .player-name {
        font-size: 0.875rem;
    }
    
    .points-highlight {
        font-size: 0.95rem;
    }
    
    .points-legend {
        font-size: 0.7rem;
        padding: 12px;
        gap: 6px;
        margin-bottom: 16px;
    }
    
    .points-legend span {
        padding: 6px 10px;
        font-size: 0.7rem;
    }
    
    .info-section {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 40px;
    }
    
    .info-card {
        padding: 20px 16px;
        border-radius: 12px;
    }
    
    .info-card h3 {
        font-size: 1.1rem;
        margin-bottom: 16px;
    }
    
    .info-card li {
        font-size: 0.875rem;
        padding: 8px 0;
        padding-left: 24px;
    }
    
    .leaderboard-section h2,
    .upcoming-section h2,
    .history-section h2 {
        font-size: 1.5rem;
        margin-bottom: 16px;
    }
    
    .leaderboard-section,
    .upcoming-section,
    .history-section {
        margin-bottom: 40px;
    }
    
    #paginationControls {
        flex-wrap: nowrap;
        gap: 10px;
        padding: 16px 12px;
        margin-top: 16px !important;
    }
    
    #paginationControls button {
        padding: 8px 14px !important;
        font-size: 0.8rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    #pageInfo {
        font-size: 0.8rem;
        white-space: nowrap;
    }
    
    /* History cards mobile */
    .history-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .history-card {
        padding: 16px;
        border-radius: 12px;
    }
    
    .history-title {
        font-size: 0.95rem;
        line-height: 1.4;
    }
    
    .history-meta {
        font-size: 0.8rem;
    }
    
    .history-stats {
        font-size: 0.8rem;
        gap: 8px;
    }
    
    .history-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .history-actions .btn {
        width: 100%;
        padding: 8px 16px;
        font-size: 0.875rem;
    }
    
    /* Modal mobile */
    .modal-overlay {
        padding: 12px;
    }
    
    .modal-content {
        max-height: 90vh;
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 14px 16px;
    }
    
    .modal-header h3 {
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: 12px 16px 16px;
    }
    
    .modal-stats {
        gap: 8px;
        font-size: 0.8rem;
    }
    
    .modal-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .modal-table table {
        min-width: 500px;
        font-size: 0.8rem;
    }
    
    .modal-table th,
    .modal-table td {
        padding: 10px 8px;
        font-size: 0.8rem;
    }
    
    footer {
        padding: 32px 16px;
        margin-top: 40px;
    }
    
    footer p {
        font-size: 0.85rem;
    }
}

/* Admin Panel Styles */
.admin-panel {
    background: var(--card-bg);
    padding: 32px;
    border-radius: 16px;
    margin-bottom: 40px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.admin-panel h2 {
    color: var(--text-primary);
    margin-bottom: 24px;
    font-weight: 600;
    font-size: 1.5rem;
}

.admin-panel h3 {
    color: var(--text-primary);
    margin-bottom: 16px;
    font-weight: 600;
    font-size: 1.125rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn {
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

/* Admin Navigation & Tabs */
.admin-nav {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.tab-btn:hover {
    background: var(--card-hover);
    transform: translateY(-1px);
}

.tab-btn.active {
    color: white;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: transparent;
    box-shadow: 0 6px 14px rgba(79, 70, 229, 0.25);
}

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

/* Admin Alerts */
.alert {
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: none;
    font-weight: 600;
}

.alert.success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid var(--success-color);
    color: var(--success-color);
}

.alert.error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid #ef4444;
    color: #ef4444;
}

/* Admin Forms & Layout */
.admin-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 20px;
}

@media (max-width: 768px) {
    .results-grid { grid-template-columns: 1fr; }
    
    .admin-panel {
        padding: 20px 14px;
        margin-bottom: 20px;
        border-radius: 12px;
    }
    
    .admin-panel h2 {
        font-size: 1.25rem;
        margin-bottom: 20px;
    }
    
    .admin-panel h3 {
        font-size: 1rem;
        margin-bottom: 14px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-group label {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 0.9rem;
        border-radius: 8px;
    }
    
    .admin-nav {
        gap: 6px;
        margin-bottom: 16px;
    }
    
    .tab-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .admin-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .admin-actions .btn {
        width: 100%;
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .import-card {
        padding: 16px 14px;
        border-radius: 10px;
        margin-bottom: 20px;
    }
    
    .import-card h3 {
        font-size: 0.95rem;
        margin-bottom: 8px;
    }
    
    .import-card p {
        font-size: 0.8rem;
        margin-bottom: 10px;
        line-height: 1.5;
    }
    
    .alert {
        padding: 12px 14px;
        font-size: 0.85rem;
        margin-bottom: 16px;
    }
    
    .results-input span {
        font-size: 0.85rem;
    }
    
    .results-input input {
        font-size: 0.9rem;
    }
}

.results-input {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: center;
}

.results-input span {
    font-weight: 700;
    color: var(--text-secondary);
}

.import-card {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.import-card h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.import-card p {
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-size: 0.95rem;
}

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

.tournament-card,
.upcoming-card,
.leaderboard,
.info-card {
    animation: fadeIn 0.6s ease-out;
}
