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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Mobile-first: Ensure text is readable */
@media (max-width: 768px) {
    body {
        font-size: 16px; /* Prevent iOS zoom on input focus */
    }
}

/* Navigation Spacer - matches nav height */
.nav-spacer {
    height: 5.5rem; /* Extra spacing for desktop/laptop */
    width: 100%;
    flex-shrink: 0;
    display: block;
    visibility: visible;
    margin: 0;
    padding: 0;
}

/* Navigation */
nav {
    background-color: #2c3e50;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 2rem;
    z-index: 1000;
    width: 100%;
    box-sizing: border-box;
    height: 4rem; /* Set explicit height for spacer calculation */
}

.nav-left {
    position: absolute;
    left: 2rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.nav-center {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-right {
    position: absolute;
    right: 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
    min-height: 44px; /* Minimum touch target size */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

nav a:hover {
    background-color: #34495e;
}

/* Hamburger Menu Button */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.3s;
}

/* Hide mobile home link on desktop */
.mobile-home-link {
    display: none;
}

.mobile-menu-toggle:hover {
    background-color: #34495e;
}

.mobile-menu-toggle:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Content */
.content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    padding-top: 0; /* Spacer handles spacing, no padding needed */
    width: 100%;
    box-sizing: border-box;
    display: block;
    position: relative;
    z-index: 1;
}

/* Welcome Content */
.welcome-content {
    text-align: center;
}

.welcome-content h1 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 2.5rem;
}

.welcome-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #666;
}

/* Auth Options */
.auth-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.auth-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s;
}

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

.auth-card h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.auth-card p {
    margin-bottom: 1.5rem;
    color: #666;
}

/* Features */
.features {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

.features h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

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

.features li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.features li:before {
    content: "-";
    color: #27ae60;
    font-weight: bold;
    margin-right: 0.5rem;
}

/* Logged In Content */
.logged-in-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.logged-in-content h1 {
    color: #2c3e50;
    margin-bottom: 2rem;
}

.user-info-section {
    margin-bottom: 2rem;
}

.user-info-section h2 {
    color: #34495e;
    margin-bottom: 1rem;
}

.user-details {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.user-details p {
    margin-bottom: 0.5rem;
}

.user-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Profile Content */
.profile-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.profile-content h1 {
    color: #2c3e50;
    margin-bottom: 2rem;
}

.profile-section {
    margin-bottom: 2rem;
}

.profile-section h2 {
    color: #34495e;
    margin-bottom: 1rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.profile-details {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 6px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #dee2e6;
}

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

.detail-row label {
    font-weight: bold;
    color: #2c3e50;
}

/* Level Badges */
.level-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: bold;
    text-transform: uppercase;
}

.level-0 {
    background-color: #e74c3c;
    color: white;
}

.level-1 {
    background-color: #f39c12;
    color: white;
}

.level-2 {
    background-color: #95a5a6;
    color: white;
}

.game-level-0 {
    background-color: #8e44ad;
    color: white;
}

.game-level-1 {
    background-color: #3498db;
    color: white;
}

.game-level-2 {
    background-color: #27ae60;
    color: white;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
    min-height: 44px; /* Minimum touch target size for mobile */
    min-width: 44px;
    touch-action: manipulation; /* Prevent double-tap zoom on iOS */
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
    transform: translateY(-2px);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2c3e50;
}

/* Labels containing checkboxes should be flex */
.form-group label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.form-group input:not([type="checkbox"]):not([type="radio"]) {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
    min-height: 44px; /* Better touch target for mobile */
    -webkit-appearance: none; /* Remove iOS styling */
    appearance: none;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6c757d;
}

/* Form Validation */
.form-group input.error,
.form-group select.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.2);
}

.error-message {
    color: #e74c3c;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.form-footer a {
    color: #3498db;
    text-decoration: none;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* Messages */
.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    border: 1px solid #c3e6cb;
}

/* Not Logged In */
.not-logged-in {
    text-align: center;
    background: white;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.not-logged-in h1 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.not-logged-in p {
    color: #666;
    margin-bottom: 2rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Upload Game Form */
.upload-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.upload-content h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.upload-content p {
    color: #666;
    margin-bottom: 2rem;
}

.game-form {
    max-width: 800px;
}

.form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.form-section h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.players-grid,
.scores-grid,
.fouls-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .players-grid {
        grid-template-columns: 1fr; /* Vertical layout for player selector on mobile */
    }
    
    .scores-grid,
    .fouls-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .players-grid,
    .scores-grid,
    .fouls-grid {
        grid-template-columns: 1fr;
    }
}

.fouls-help {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    margin-top: 0.5rem;
}

.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background-color: white;
    transition: border-color 0.3s;
    min-height: 44px; /* Better touch target for mobile */
    -webkit-appearance: none;
    appearance: none;
}

.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.form-group input[type="checkbox"] {
    width: auto;
    min-width: 18px;
    height: 18px;
    min-height: 18px;
    margin-right: 0.5rem;
    padding: 0;
    border: 2px solid #3498db;
    border-radius: 3px;
    background-color: white;
    cursor: pointer;
    -webkit-appearance: checkbox; /* Restore native checkbox appearance */
    appearance: checkbox;
    transform: none;
    vertical-align: middle;
    flex-shrink: 0;
}

.form-group input[type="checkbox"]:checked {
    background-color: #3498db;
    border-color: #3498db;
}

.form-group input[type="checkbox"]:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}


.form-actions {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

/* Logout Page */
.logout-content {
    background: white;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
}

.logout-content h1 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.logout-content p {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.logout-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Admin Panel */
.admin-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.admin-content h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.admin-content p {
    color: #666;
    margin-bottom: 1rem;
}

.admin-actions {
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.admin-actions .btn {
    margin-right: 1rem;
}

.admin-sections {
    display: grid;
    gap: 2rem;
}

.admin-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 6px;
}

.admin-section h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

/* Games Table */
.games-table-container {
    overflow-x: auto;
    margin-top: 1rem;
    width: 100%;
    max-width: 100%;
    position: relative;
}

.games-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    table-layout: auto; /* Auto layout on desktop for natural sizing */
}

.games-table th {
    background-color: #2c3e50;
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: bold;
}

.games-table td {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
}

/* Ensure action buttons in games table align consistently */
.games-table td .action-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
}

.games-table td .action-buttons form {
    display: contents; /* Form becomes transparent, button becomes direct flex child */
    margin: 0;
    padding: 0;
}

.games-table td .action-buttons form button,
.games-table td .action-buttons button {
    margin: 0;
    flex-shrink: 0;
}

.games-table tr:hover {
    background-color: #f8f9fa;
}

.player-info, .score-info {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

.status-pending {
    color: #f39c12;
    font-weight: bold;
}

.status-approved {
    color: #27ae60;
    font-weight: bold;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
}

/* Ensure forms inside action-buttons align with buttons - treat form as a flex item, not a container */
.action-buttons form {
    display: contents; /* Form becomes transparent, button becomes direct flex child */
    margin: 0;
    padding: 0;
}

.action-buttons form button,
.action-buttons button {
    margin: 0;
    flex-shrink: 0;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

.no-games {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.system-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal[style*="display: none"] {
    display: none !important;
}

.modal[style*="display: block"] {
    display: flex !important;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 1.5rem;
        max-height: 85vh;
        margin: 5vh auto;
    }
}

.modal-content h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.modal-content p {
    color: #666;
    margin-bottom: 2rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* User Management Table */
.users-table-container,
.admin-table-container {
    overflow-x: auto;
    margin-top: 1rem;
    width: 100%;
    max-width: 100%;
    position: relative;
}

.users-table,
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.users-table th,
.admin-table th {
    background-color: #2c3e50;
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: bold;
}

.users-table td,
.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

/* Ensure action buttons in admin tables align properly */
.admin-table td .action-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-table td form {
    display: inline-block;
    margin: 0;
    padding: 0;
    vertical-align: middle;
}

.admin-table td form + form {
    margin-left: 0.5rem;
}

.admin-table td form button {
    display: inline-block;
    vertical-align: middle;
    margin: 0;
}

.users-table tr:hover,
.admin-table tr:hover {
    background-color: #f8f9fa;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #3498db;
}

.default-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    border: 2px solid #3498db;
}

.level-select {
    padding: 0.25rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 0.8rem;
    min-width: 40px;
    max-width: 100px;
    width: auto;
}

.level-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.text-muted {
    color: #6c757d;
    font-style: italic;
}

.no-users {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

/* Rankings Page */
.rankings-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.ranking-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.tab-button {
    padding: 0.75rem 1.5rem;
    border: 2px solid #3498db;
    background: white;
    color: #3498db;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.tab-button:hover {
    background: #f8f9fa;
}

.tab-button.active {
    background: #3498db;
    color: white;
}

.rankings-content h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    text-align: center;
}

.rankings-content p {
    color: #666;
    margin-bottom: 2rem;
    text-align: center;
}

.rankings-sections {
    display: grid;
    gap: 3rem;
}

.ranking-section {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ranking-section h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    text-align: center;
    border-bottom: 3px solid #3498db;
    padding-bottom: 0.5rem;
}

.ranking-table-container {
    overflow-x: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
}

.ranking-table-container::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to right, transparent, rgba(248, 249, 250, 0.9));
    pointer-events: none;
    display: none;
}

@media (max-width: 768px) {
    .ranking-table-container::after {
        display: none !important; /* Hide the gradient mask on mobile */
    }
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    table-layout: auto; /* Auto layout on desktop for natural sizing */
}

.ranking-table th {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: bold;
    font-size: 1.1rem;
}

.ranking-table td {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.ranking-table tr:hover {
    background-color: #f8f9fa;
}

/* Top 3 players highlighting */
.top-player {
    background: linear-gradient(135deg, #fff9c4, #fff3cd) !important;
    border-left: 4px solid #ffc107;
}

.top-player:hover {
    background: linear-gradient(135deg, #fff8b3, #ffecb3) !important;
}

/* Last place highlighting */
.bottom-player {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb) !important;
    border-left: 4px solid #dc3545;
}

.bottom-player:hover {
    background: linear-gradient(135deg, #f5c6cb, #f1b0b7) !important;
}

.rank-cell {
    text-align: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.rank-number {
    display: inline-block;
    min-width: 2rem;
}

.rank-medal {
    margin-left: 0.5rem;
    font-size: 1.5rem;
}

.player-cell {
    min-width: 200px;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.player-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.level-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-align: center;
    min-width: 2rem;
}

.level-0 {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #8b6914;
    border: 1px solid #ffd700;
}

.level-1 {
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
    color: #666;
    border: 1px solid #c0c0c0;
}

.level-2 {
    background: linear-gradient(135deg, #cd7f32, #daa520);
    color: #8b4513;
    border: 1px solid #cd7f32;
}

.player-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #3498db;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.default-avatar {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Profile Picture Section */
.profile-picture-section {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.current-picture {
    flex-shrink: 0;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #3498db;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.default-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 3rem;
    border: 4px solid #3498db;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.upload-form {
    flex: 1;
    min-width: 250px;
}

.upload-form input[type="file"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background: white;
}

.upload-form input[type="file"]:focus {
    outline: none;
    border-color: #3498db;
}

.player-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: #2c3e50;
}

.points-cell {
    text-align: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.points-value {
    color: #27ae60;
    font-size: 1.3rem;
}

.games-cell, .avg-cell {
    text-align: center;
    font-weight: 500;
}

.no-players {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-style: italic;
}

/* Responsive adjustments for rankings */
@media (max-width: 768px) {
    .rankings-content {
        padding: 0;
        border-radius: 0;
        box-shadow: none;
        margin: 0;
        background: transparent;
    }
    
    .ranking-section {
        padding: 1rem;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }
    
    .ranking-tabs {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .tab-button {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .player-info {
        flex-direction: row;
        gap: 0.5rem;
        align-items: center;
        text-align: left;
    }
    
    .player-avatar {
        width: 32px;
        height: 32px;
    }
    
    .player-name {
        font-size: 0.9rem !important;
    }
    
    .ranking-table {
        width: 100%;
        font-size: 0.85rem;
        table-layout: fixed; /* Use fixed layout for better control */
        margin: 0;
        display: table;
    }
    
    .games-table {
        width: 100%;
        table-layout: fixed; /* Use fixed layout for better control */
        margin: 0;
        display: table;
    }
    
    /* Make table columns responsive - account for hidden rank column */
    .ranking-table th:nth-child(2),
    .ranking-table td:nth-child(2) {
        width: 45%; /* Player column */
    }
    
    .ranking-table th:nth-child(3),
    .ranking-table td:nth-child(3) {
        width: 30%; /* Points column */
    }
    
    .ranking-table th:nth-child(4),
    .ranking-table td:nth-child(4) {
        width: 25%; /* Games column */
    }
    
    /* For tables with level column (accumulative rankings) */
    .ranking-table th:nth-child(3).level-cell,
    .ranking-table td:nth-child(3).level-cell {
        width: 15%;
    }
    
    .ranking-table th:nth-child(4).points-cell,
    .ranking-table td:nth-child(4).points-cell {
        width: 30%;
    }
    
    .ranking-table th:nth-child(5),
    .ranking-table td:nth-child(5) {
        width: 20%;
    }
    
    .games-table-container {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
        margin: 0;
        padding: 0;
    }
    
    /* Hide Game ID, Date, and Session columns on mobile */
    .games-table th:nth-child(1),
    .games-table td:nth-child(1),
    .games-table th:nth-child(2),
    .games-table td:nth-child(2),
    .games-table th:nth-child(3),
    .games-table td:nth-child(3) {
        display: none;
    }
    
    /* Hide profile pictures in games table */
    .games-table .player-avatar-small,
    .games-table .default-avatar-small {
        display: none;
    }
    
    .ranking-table th,
    .ranking-table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .ranking-table-container {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        display: block !important;
        position: relative;
        margin: 0;
        padding: 0;
        left: 0;
        right: 0;
    }
    
    .ranking-table-container::after {
        display: none !important; /* Ensure no gradient mask on mobile */
        content: none !important;
    }
    
    .ranking-table {
        width: 100%;
        margin: 0;
        display: table;
        position: relative;
        table-layout: fixed;
    }
    
    /* Merge rank and player columns on mobile */
    .ranking-table th:first-child,
    .ranking-table td:first-child {
        display: none;
    }
    
    /* Show rank numbers using CSS counter in player column */
    .ranking-table tbody {
        counter-reset: rank;
    }
    
    .ranking-table tbody tr {
        counter-increment: rank;
    }
    
    .ranking-table td:nth-child(2) {
        position: relative;
        padding-left: 1.75rem !important;
        min-width: 0;
    }
    
    .ranking-table td:nth-child(2)::before {
        content: counter(rank) '. ';
        position: absolute;
        left: 0.25rem;
        font-weight: bold;
        font-size: 0.9rem;
        color: #2c3e50;
    }
    
    .player-cell {
        min-width: 0;
        max-width: 100%;
    }
    
    .player-name {
        word-break: break-word;
        overflow-wrap: break-word;
    }
    
    .points-cell,
    .games-cell {
        white-space: nowrap;
        text-align: center;
    }
    
    .rank-cell {
        display: none;
    }
    
    .points-value {
        font-size: 1rem !important;
    }
    
    .level-badge {
        font-size: 0.65rem !important;
        padding: 0.15rem 0.35rem !important;
    }
    
    /* Hide some columns on very small screens */
    @media (max-width: 480px) {
        .tab-button {
            padding: 0.4rem 0.8rem;
            font-size: 0.75rem;
        }
        
        .ranking-table th:nth-child(4),
        .ranking-table td:nth-child(4) {
            display: none;
        }
        
        .ranking-table th,
        .ranking-table td {
            padding: 0.4rem 0.3rem;
            font-size: 0.75rem;
        }
        
        /* Hide Game ID, Date, and Session columns on very small screens */
        .games-table th:nth-child(1),
        .games-table td:nth-child(1),
        .games-table th:nth-child(2),
        .games-table td:nth-child(2),
        .games-table th:nth-child(3),
        .games-table td:nth-child(3) {
            display: none;
        }
    }
}

/* Language Switching */
.lang-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.lang-btn:hover {
    background: #2980b9;
}

/* Games Page */
.games-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Edit Game Page */
.edit-game-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-width: 800px;
    margin: 0 auto;
}

.edit-game-form {
    margin-top: 2rem;
}

.form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.form-section h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #2c3e50;
    font-size: 1.2rem;
}

.players-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.player-score-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: white;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.player-info {
    font-weight: 500;
    color: #495057;
}

.score-input input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #dee2e6;
}

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

/* Profile Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

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

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

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

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

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Profile Rankings Tabs */
.rankings-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tab-button {
    padding: 0.75rem 1.5rem;
    border: 2px solid #e9ecef;
    background: white;
    color: #495057;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tab-button:hover {
    border-color: #007bff;
    color: #007bff;
}

.tab-button.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

.tab-content {
    display: none;
}

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

.tab-content h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
}

/* Edit Game Modal */
.edit-modal-content {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.edit-modal-content .form-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.edit-modal-content .form-section h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #2c3e50;
    font-size: 1.1rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.edit-modal-content .players-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.edit-modal-content .player-score-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: white;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.edit-modal-content .player-info {
    font-weight: 500;
    color: #495057;
}

.edit-modal-content .score-input input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
}

.games-content h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    text-align: center;
}

.games-content p {
    color: #666;
    margin-bottom: 1rem;
    text-align: center;
}

.games-actions {
    text-align: center;
    margin-bottom: 2rem;
}

.games-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
}

.players-list, .scores-list, .point-changes-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: flex-start;
}

.player-entry, .score-entry, .point-change-entry {
    width: 100%;
    min-height: 1.5rem;
    display: flex;
    align-items: center;
    padding: 0.25rem 0;
}

/* .point-change-entry styles are defined above in .player-entry, .score-entry, .point-change-entry */

.point-change-value {
    font-weight: bold;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.point-change-value.positive {
    color: #28a745;
    background-color: rgba(40, 167, 69, 0.1);
}

.point-change-value.negative {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

.player-entry, .score-entry, .point-change-entry {
    display: flex;
    align-items: center;
    min-height: 1.5rem; /* Ensure consistent height for alignment */
    padding: 0.25rem 0;
}

.score-entry {
    justify-content: flex-start;
}

.point-change-entry {
    justify-content: flex-start;
}

.score-value {
    font-weight: bold;
    color: #27ae60;
}

.game-id {
    font-weight: bold;
    color: #3498db;
}

.game-date {
    font-size: 0.9rem;
    color: #666;
}

.game-session {
    text-align: center;
    font-weight: bold;
}

.game-status {
    text-align: center;
}

.status-approved {
    color: #27ae60;
    font-weight: bold;
}

.status-pending {
    color: #f39c12;
    font-weight: bold;
}

.status-approved small, .status-pending small {
    display: block;
    font-size: 0.8rem;
    color: #666;
    font-weight: normal;
}

/* Mobile Card Layout for Tables */
.mobile-card-view {
    display: none; /* Hidden on desktop by default */
}

.mobile-card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mobile-card-header {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #3498db;
}

.mobile-card-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.mobile-card-row:last-child {
    border-bottom: none;
}

.mobile-card-label {
    font-weight: 500;
    color: #666;
}

.mobile-card-value {
    color: #2c3e50;
    text-align: right;
}

/* Responsive Design */
@media (max-width: 768px) {
    .content {
        padding: 0.5rem !important;
        padding-top: 0 !important; /* Spacer handles spacing, no padding needed */
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        display: block;
        position: relative;
    }
    
    /* Add more side padding for forms on mobile */
    .content form,
    #create-user-form {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
    
    body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }
    
    html {
        overflow-x: hidden;
        width: 100%;
    }
    
    /* Remove background and padding from content container on mobile */
    body {
        background-color: #f5f5f5;
    }
    
    .auth-options {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 2rem 0;
    }
    
    .auth-card {
        padding: 1.5rem;
    }
    
    .user-actions,
    .action-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .user-actions .btn,
    .action-buttons .btn {
        width: 100%;
    }
    
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    /* Mobile Navigation with Hamburger Menu */
    nav {
        flex-direction: column;
        padding: 0;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        width: 100%;
        box-sizing: border-box;
        min-height: 3.5rem; /* Ensure consistent nav height */
        padding-top: 0.75rem; /* Add padding to contain menu button */
        padding-bottom: 0.75rem;
        height: auto; /* Allow nav to grow on mobile */
    }
    
    /* Nav spacer matches mobile nav height */
    .nav-spacer {
        height: 5rem !important; /* Mobile nav height: 3.5rem min-height + 0.75rem top + 0.75rem bottom */
        width: 100% !important;
        flex-shrink: 0;
        display: block !important;
        visibility: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        min-height: 5rem !important;
        background-color: transparent; /* Ensure it takes up space */
        position: relative;
        z-index: 0;
    }
    
    .mobile-menu-toggle {
        display: flex;
        position: absolute;
        left: 0.5rem;
        top: 0.5rem;
        z-index: 1001;
        align-items: center;
        justify-content: center;
        height: 2.5rem;
        width: 2.5rem;
        margin: 0;
    }
    
    .content {
        padding-top: 0 !important; /* Remove padding since spacer handles it */
        margin-top: 0 !important;
    }
    
    /* Hide nav-left on mobile */
    .nav-left {
        display: none;
    }
    
    .nav-center,
    .nav-right {
        position: static !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        flex-direction: column !important;
        gap: 0 !important;
        display: none; /* Hide by default, no animation */
        order: 2;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        align-items: stretch !important;
    }
    
    nav.menu-open .nav-center,
    nav.menu-open .nav-right {
        display: flex !important; /* Show instantly when menu is open */
        padding: 0.5rem 0 !important;
        position: relative !important;
        z-index: 1001;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
    }
    
    /* Gray transparent overlay - only on mobile */
    .mobile-menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        width: 100%;
        height: 100%;
    }
    
    /* Hide overlay on desktop */
    @media (min-width: 769px) {
        .mobile-menu-overlay {
            display: none !important;
        }
    }
    
    nav a {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 1rem;
        text-align: center; /* Center align all nav links */
        border-radius: 0;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    nav a:last-child {
        border-bottom: none;
    }
    
    /* Ensure consistent alignment for all nav groups */
    .nav-center a,
    .nav-right a {
        text-align: center;
        justify-content: center;
        width: 100%;
        margin: 0;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Nav separator line between nav-center and nav-right */
    .nav-separator {
        width: 100%;
        height: 1px;
        background-color: rgba(255, 255, 255, 0.3);
        margin: 0.5rem 0;
        display: none;
        order: 2;
    }
    
    nav.menu-open .nav-separator {
        display: block;
    }
    
    /* Ensure nav-right comes after separator */
    nav.menu-open .nav-right {
        order: 3;
    }
    
    /* Fix language button alignment on mobile - restore blue highlight */
    .nav-right .lang-btn,
    nav.menu-open .nav-right .lang-btn,
    nav a.lang-btn {
        text-align: center !important;
        justify-content: center !important;
        width: 100% !important;
        margin: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        display: flex !important;
        align-items: center !important;
        border-radius: 4px !important;
        background-color: #3498db !important;
        color: white !important;
        position: relative !important;
        left: auto !important;
        right: auto !important;
        float: none !important;
        margin-top: 0.5rem !important;
    }
    
    .nav-right .lang-btn:hover {
        background-color: #2980b9 !important;
    }
    
    /* Ensure nav-right container doesn't have positioning issues */
    nav.menu-open .nav-right {
        align-items: stretch !important;
    }
    
    nav.menu-open .nav-right a {
        align-self: stretch !important;
    }
    
    /* Hide mobile home link by default, only show when menu is open */
    .nav-center .mobile-home-link {
        display: none !important;
    }
    
    /* Show mobile-home-link only when dropdown menu is open */
    nav.menu-open .nav-center .mobile-home-link {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Keep tables visible but make them scrollable on mobile */
    .games-table-container,
    .ranking-table-container,
    .users-table-container,
    .admin-table-container {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        max-width: 100%;
        position: relative;
        margin: 0;
        padding: 0;
    }
    
    /* Remove any gradient masks on mobile */
    .games-table-container::after,
    .ranking-table-container::after,
    .users-table-container::after,
    .admin-table-container::after {
        display: none !important;
    }
    
    /* Ensure admin tables fit properly on mobile */
    .admin-table,
    .users-table {
        width: 100%;
        table-layout: fixed; /* Use fixed layout for better control */
    }
    
    /* Hide email, games columns, and profile pic in users table on mobile */
    .users-table th:nth-child(2),
    .users-table td:nth-child(2),
    .users-table th:nth-child(6),
    .users-table td:nth-child(6) {
        display: none;
    }
    
    /* Hide profile picture/avatar in username column on mobile */
    .users-table .user-info .user-avatar-small,
    .users-table .user-info img.user-avatar-small {
        display: none;
    }
    
    .mobile-card-view {
        display: block;
    }
    
    /* Improve form sections on mobile */
    .form-section {
        padding: 1rem;
    }
    
    /* Make all player grids vertical on mobile */
    .players-grid,
    .edit-modal-content .players-grid {
        grid-template-columns: 1fr !important;
    }
    
    .upload-content,
    .profile-content,
    .games-content,
    .rankings-content,
    .admin-content,
    .logged-in-content {
        padding: 1rem;
        width: 100%;
        box-sizing: border-box;
        max-width: 100%;
    }
    
    .logged-in-content,
    .welcome-content,
    .not-logged-in {
        width: 100%;
        box-sizing: border-box;
        max-width: 100%;
        display: block;
        position: relative;
        min-height: auto;
    }
    
    /* Better spacing for headings */
    h1 {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }
    
    h2 {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    /* Improve notifications on mobile */
    .notification-item {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .notification-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .notification-actions .btn {
        width: 100%;
    }
    
    /* Profile picture section */
    .profile-picture-section {
        flex-direction: column;
        align-items: center;
    }
    
    .upload-form {
        width: 100%;
    }
    
    /* Stats grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    /* Session game items */
    .session-game-item {
        padding: 0.75rem;
    }
    
    .game-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    /* Ranking sections */
    .ranking-section {
        padding: 1rem;
    }
    
    .session-rankings-section .rankings-sections {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .session-rankings-section {
        padding: 1rem !important;
        margin-top: 1rem;
        width: 100%;
        box-sizing: border-box;
    }
    
    .session-rankings-section .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .session-rankings-section .section-header h2 {
        font-size: 1.25rem;
        width: 100%;
    }
    
    .session-rankings-section .section-header .btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 500px) {
    /* Hide User Level column on very small screens */
    .users-table th:nth-child(3),
    .users-table td:nth-child(3) {
        display: none;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .content {
        padding: 0.25rem !important;
    }
    
    .upload-content,
    .profile-content,
    .games-content,
    .rankings-content,
    .admin-content,
    .logged-in-content {
        padding: 0.75rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 1.75rem;
    }
    
    .auth-card {
        padding: 1rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
    }
    
    /* Tab buttons */
    .tab-button {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* reCAPTCHA styling */
.g-recaptcha {
    margin: 1rem 0;
    display: flex;
    justify-content: center;
}

.g-recaptcha > div {
    margin: 0 auto;
}

/* Notifications Styles */
.notifications-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.notifications-section h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.notification-item {
    padding: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #f9f9f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.notification-item.unread {
    background: #e3f2fd;
    border-color: #2196f3;
    border-left: 4px solid #2196f3;
}

.notification-content {
    flex: 1;
}

.notification-message {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #333;
}

.notification-time {
    font-size: 0.9rem;
    color: #666;
}

.notification-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.btn-small.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-small.btn-primary:hover {
    background-color: #0056b3;
}

.btn-small.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-small.btn-secondary:hover {
    background-color: #545b62;
}

.no-notifications {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2rem;
}

/* Session Scores Styles */
.session-scores-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.session-scores-section h2 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin: 0;
}

.session-games-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.session-game-item {
    padding: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #f9f9f9;
    transition: all 0.3s ease;
}

.session-game-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: #3498db;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.game-id {
    font-weight: bold;
    color: #3498db;
    font-size: 1rem;
}

.game-date {
    font-size: 0.9rem;
    color: #666;
}

.game-players-scores {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.player-score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
}

.player-score-row .player-name {
    font-weight: 500;
    color: #333;
    flex: 1;
}

.player-score-row .score-value {
    font-weight: bold;
    color: #27ae60;
    margin-right: 1rem;
    min-width: 80px;
    text-align: right;
}

.player-score-row .point-change-value {
    font-weight: bold;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    min-width: 60px;
    text-align: right;
}

.no-games {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2rem;
}

/* Session Rankings Styles */
.session-rankings-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.session-rankings-section h2 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin: 0;
}

.session-rankings-section .rankings-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .session-rankings-section .rankings-sections {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .session-rankings-section {
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .session-rankings-section .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .session-rankings-section .section-header h2 {
        font-size: 1.25rem;
        width: 100%;
    }
    
    .session-rankings-section .section-header .btn {
        width: 100%;
        text-align: center;
    }
    
    .session-rankings-section .ranking-section {
        padding: 1rem;
        margin: 0;
    }
    
    .session-rankings-section .ranking-section h3 {
        font-size: 1.1rem;
    }
}

.session-rankings-section .ranking-section {
    margin: 0;
    padding: 1.5rem;
}

.session-rankings-section .ranking-section h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    text-align: center;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
    font-size: 1.2rem;
}

.session-rankings-section .no-players {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2rem;
}

/* Verification Status Styles */
.verification-status {
    font-size: 0.9rem;
    color: #666;
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

.status-badge.approved {
    background-color: #27ae60;
    color: #fff;
    border: 1px solid #219150;
}

/* Events Board Styles */
.events-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.events-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.event-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.event-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f5f5f5;
}

.event-header h2 {
    flex: 1;
    margin: 0;
    color: #2c3e50;
}

.event-creator {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.event-date {
    color: #95a5a6;
    font-size: 0.85rem;
}

.event-image {
    margin: 1.5rem 0;
    border-radius: 8px;
    overflow: hidden;
}

.event-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.event-description {
    margin: 1.5rem 0;
    line-height: 1.6;
    color: #555;
}

.event-comments-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f5f5f5;
}

.event-comments-section h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.comment-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    border-left: 3px solid #3498db;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #3498db;
    color: white;
    font-weight: bold;
    font-size: 0.85rem;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.comment-name {
    font-weight: 600;
    color: #2c3e50;
}

.comment-content {
    margin: 0.5rem 0;
    color: #555;
    line-height: 1.5;
}

.comment-time {
    font-size: 0.8rem;
    color: #95a5a6;
}

.add-comment-form {
    margin-top: 1rem;
}

.add-comment-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    margin-bottom: 0.5rem;
}

.add-comment-form textarea:focus {
    outline: none;
    border-color: #3498db;
}

.already-commented {
    padding: 1rem;
    background: #e8f5e9;
    border-radius: 6px;
    text-align: center;
}

.already-commented .text-muted {
    color: #43a047;
    margin: 0;
}

.login-prompt {
    text-align: center;
    margin-top: 1rem;
}

.no-events {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-style: italic;
}

/* Mobile responsive for events */
@media (max-width: 768px) {
    .events-content {
        padding: 1rem;
    }
    
    .event-card {
        padding: 1rem;
    }
    
    .event-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .event-header h2 {
        font-size: 1.25rem;
    }
}