:root {
    --primary-color: #1a4d7a;
    --primary-dark: #0f3557;
    --secondary-color: #f59e42;
    --accent-purple: #7b5fb5;
    --accent-coral: #ff6b7a;
    --background: #0a1929;
    --surface: #132f4c;
    --surface-light: #1e4976;
    --text-primary: #ffffff;
    --text-secondary: #b0c4de;
    --success: #4ade80;
    --error: #ef4444;
    --gold: #ffd700;
    --silver: #c0c0c0;
    --bronze: #cd7f32;
}

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

body {
    font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--background) 0%, #0f2744 100%);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 25, 41, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(8px);
}

.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0a1929;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 60px;
    height: 60px;
    position: relative;
    border: none;
    animation: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

.spinner::before {
    content: '♔';
    font-size: 48px;
    color: var(--secondary-color);
    animation: pulse-king 1.5s ease-in-out infinite;
    z-index: 2;
}

.spinner::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--secondary-color);
    opacity: 0;
    animation: ripple 1.5s ease-out infinite;
}

@keyframes pulse-king {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes ripple {
    0% { transform: scale(0.8); opacity: 0.5; border-width: 4px; }
    100% { transform: scale(2); opacity: 0; border-width: 0px; }
}

/* Auth Container */
.auth-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: 
        radial-gradient(circle at 20% 30%, rgba(123, 95, 181, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(245, 158, 66, 0.15) 0%, transparent 50%),
        var(--background);
}

.auth-card {
    background: rgba(19, 47, 76, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px 30px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeInUp 0.6s ease;
}

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

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.chess-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.app-title {
    font-family: 'Righteous', cursive;
    font-size: 42px;
    color: var(--secondary-color);
    margin-bottom: 8px;
    letter-spacing: 1px;
    text-shadow: 0 2px 20px rgba(245, 158, 66, 0.3);
}

.app-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
}

.auth-form h2 {
    font-size: 24px;
    margin-bottom: 24px;
    font-weight: 700;
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--secondary-color);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(245, 158, 66, 0.1);
}

.input-group input::placeholder {
    color: rgba(176, 196, 222, 0.5);
}

.btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary-color), #e8893c);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 66, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 66, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-google {
    background: white;
    color: #1f1f1f;
    margin-top: 12px;
}

.btn-google:hover {
    background: #f8f8f8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.divider span {
    padding: 0 16px;
}

.auth-switch {
    text-align: center;
    margin-top: 24px;
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-switch a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* App Container */
.app-container {
    min-height: 100vh;
    max-width: 600px;
    margin: 0 auto;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--background) 50%);
    position: relative;
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.6);
}

/* Leaderboard View Enhancements */
#leaderboardView {
    background: 
        radial-gradient(circle at 10% 20%, rgba(123, 95, 181, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(245, 158, 66, 0.08) 0%, transparent 40%),
        transparent;
    min-height: calc(100vh - 84px);
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px;
    background: var(--primary-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.back-btn,
.profile-btn,
.header-icon-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.back-btn:hover,
.profile-btn:hover,
.header-icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-title {
    font-family: 'Righteous', cursive;
    font-size: 24px;
    letter-spacing: 0.5px;
}

.header-avatar {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    object-fit: cover;
}

/* Views */
.view {
    display: none;
    animation: fadeIn 0.4s ease;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Podium */
.podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 50px 20px 40px;
    gap: 16px;
    position: relative;
    background: linear-gradient(180deg, rgba(26, 77, 122, 0.3) 0%, transparent 100%);
    margin-bottom: 30px;
}

.podium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 150px;
    background: radial-gradient(ellipse at top, rgba(255, 215, 0, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.podium-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    animation: scaleIn 0.5s ease backwards;
    z-index: 1;
}

.podium-item.first {
    animation-delay: 0.2s;
    transform: scale(1.05);
}

.podium-item.second {
    animation-delay: 0.1s;
}

.podium-item.third {
    animation-delay: 0.3s;
}

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

.crown {
    position: absolute;
    top: -40px;
    font-size: 36px;
    animation: bounce 2s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(255, 215, 0, 0.4));
}

@keyframes bounce {
    0%, 100% { transform: translateY(0) rotate(-10deg); }
    50% { transform: translateY(-12px) rotate(10deg); }
}

.podium-avatar-container {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-coral));
    margin-bottom: 16px;
    position: relative;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

.podium-avatar-container:hover {
    transform: scale(1.1);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.podium-item.first .podium-avatar-container {
    width: 110px;
    height: 110px;
    background: linear-gradient(135deg, var(--gold), #ffed4e);
    box-shadow: 0 16px 48px rgba(255, 215, 0, 0.4);
}

.podium-item.second .podium-avatar-container {
    background: linear-gradient(135deg, var(--silver), #e8e8e8);
    box-shadow: 0 12px 32px rgba(192, 192, 192, 0.3);
}

.podium-item.third .podium-avatar-container {
    background: linear-gradient(135deg, var(--bronze), #e09e5e);
    box-shadow: 0 12px 32px rgba(205, 127, 50, 0.3);
}

.podium-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface);
}

.podium-rank {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-purple);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.podium-item.first .podium-rank {
    top: -16px;
    background: var(--gold);
    color: #333;
    width: 36px;
    height: 36px;
    font-size: 18px;
}

.podium-item.second .podium-rank {
    background: var(--silver);
    color: #333;
}

.podium-item.third .podium-rank {
    background: var(--bronze);
    color: white;
}

.podium-info {
    text-align: center;
    background: rgba(19, 47, 76, 0.4);
    backdrop-filter: blur(20px);
    padding: 14px 18px;
    border-radius: 18px;
    min-width: 110px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.podium-info:hover {
    background: rgba(19, 47, 76, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.podium-item.first .podium-info {
    border: 1px solid rgba(255, 215, 0, 0.3);
    background: rgba(255, 215, 0, 0.1);
}

.podium-name {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.podium-score {
    color: var(--secondary-color);
    font-weight: 700;
    font-size: 15px;
    text-shadow: 0 2px 8px rgba(245, 158, 66, 0.4);
}

/* Leaderboard List */
.leaderboard-list {
    padding: 0 20px 20px;
    position: relative;
}

.leaderboard-list::before {
    content: 'Rankings';
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    border-left: 4px solid var(--secondary-color);
    padding-left: 12px;
}

/* Stats Cards */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    padding: 0 20px 20px;
    animation: fadeIn 0.6s ease;
}

.stat-card-horizontal {
    background: rgba(19, 47, 76, 0.6);
    backdrop-filter: blur(10px);
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.stat-card-horizontal:hover {
    transform: translateY(-2px);
    background: rgba(19, 47, 76, 0.8);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.stat-icon {
    font-size: 32px;
    line-height: 1;
}

.stat-details {
    flex: 1;
}

.stat-details .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
}

.stat-details .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--secondary-color);
}

/* Recent Matches Section */
.recent-matches-section {
    padding: 0 20px 100px;
    margin-top: 32px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
    border-left: 4px solid var(--secondary-color);
    padding-left: 12px;
}

.recent-matches {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(19, 47, 76, 0.6);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 66, 0.3);
}

.pagination-btn.active {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    box-shadow: 0 4px 12px rgba(245, 158, 66, 0.3);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-dots {
    color: var(--text-secondary);
    font-weight: 700;
    padding: 0 8px;
}

.match-item {
    background: rgba(19, 47, 76, 0.6);
    backdrop-filter: blur(10px);
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideInRight 0.4s ease backwards;
}

.match-players {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.match-player {
    display: flex;
    align-items: center;
    gap: 8px;
}

.match-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--surface);
}

.match-name {
    font-size: 14px;
    font-weight: 600;
}

.match-result {
    font-size: 12px;
    color: var(--text-secondary);
}

.match-vs {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
}

.match-info {
    text-align: right;
}

.match-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.match-points {
    font-size: 14px;
    font-weight: 700;
    margin-top: 4px;
}

.match-points.winner {
    color: var(--success);
}

.match-points.loser {
    color: var(--accent-coral);
}

/* Leaderboard List */
.leaderboard-list {
    padding: 0 20px 20px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(19, 47, 76, 0.6);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 20px;
    margin-bottom: 14px;
    border: 2px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
    animation: slideInRight 0.4s ease backwards;
    position: relative;
    overflow: hidden;
}

.leaderboard-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg, var(--secondary-color), var(--accent-purple));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.leaderboard-item:hover {
    transform: translateY(-2px);
    background: rgba(19, 47, 76, 0.8);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border-color: rgba(245, 158, 66, 0.3);
}

.leaderboard-item:hover::before {
    opacity: 1;
}

.leaderboard-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.leaderboard-rank {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 32px;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 12px;
    border-radius: 10px;
}

.leaderboard-avatar {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    object-fit: cover;
    background: var(--surface);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.leaderboard-info {
    flex: 1;
}

.leaderboard-name {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-advanced {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.badge-intermediate {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.badge-novice {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.badge-learning {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.leaderboard-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-icon {
    font-size: 16px;
}

.leaderboard-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.leaderboard-score {
    color: var(--secondary-color);
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.score-icon {
    font-size: 20px;
}

.leaderboard-winrate {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--success), #22c55e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

/* FAB Button */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary-color), #e8893c);
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(245, 158, 66, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 50;
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 12px 32px rgba(245, 158, 66, 0.5);
}

.fab:active {
    transform: scale(1.05) rotate(90deg);
}

/* Profile View */
.profile-container {
    padding: 30px 20px 40px;
}

.profile-avatar-section {
    text-align: center;
    margin-bottom: 32px;
}

.avatar-upload-container {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 4px solid var(--secondary-color);
    object-fit: cover;
    background: var(--surface);
}

.avatar-upload-btn {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary-color), #e8893c);
    border: 3px solid var(--background);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.avatar-upload-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(245, 158, 66, 0.4);
}

.avatar-upload-btn:active {
    transform: scale(1.05);
}

.profile-name {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.profile-email {
    color: var(--text-secondary);
    font-size: 14px;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.stat-card {
    background: rgba(19, 47, 76, 0.6);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 6px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.profile-form {
    background: rgba(19, 47, 76, 0.6);
    backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-form h3 {
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 600;
}

/* SweetAlert2 Custom Styles */
.swal2-popup {
    background: var(--surface) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 20px !important;
}

.swal2-title {
    color: var(--text-primary) !important;
    font-family: 'Righteous', cursive !important;
}

.swal2-html-container {
    color: var(--text-secondary) !important;
}

.swal2-styled.swal2-confirm {
    background: linear-gradient(135deg, var(--secondary-color), #e8893c) !important;
    border-radius: 12px !important;
    padding: 12px 32px !important;
    font-weight: 600 !important;
}

.swal2-styled.swal2-cancel {
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    padding: 12px 32px !important;
}

/* Responsive Design */
@media (max-width: 480px) {
    .auth-card {
        padding: 32px 24px;
    }

    .app-title {
        font-size: 36px;
    }

    .podium {
        padding: 30px 15px 20px;
        gap: 8px;
    }

    .podium-avatar-container {
        width: 70px;
        height: 70px;
    }

    .podium-item.first .podium-avatar-container {
        width: 90px;
        height: 90px;
    }

    .podium-info {
        padding: 10px 12px;
        min-width: 85px;
    }

    .podium-name {
        font-size: 12px;
    }

    .podium-score {
        font-size: 13px;
    }

    .leaderboard-list {
        padding: 0 15px 100px;
    }

    .fab {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }

    .profile-avatar {
        width: 100px;
        height: 100px;
    }

    .profile-name {
        font-size: 24px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 24px;
    }
}

.profile-stats-extended {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.match-history-section {
    background: rgba(19, 47, 76, 0.6);
    backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.clock-display {
    /* Full Screen Clock Mode */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, var(--background) 0%, #0f2744 100%);
    z-index: 1000;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.floating-exit-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
}

.floating-exit-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.clocks-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.match-history-section h3 {
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 600;
}

.user-match-history {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.user-match-history::-webkit-scrollbar {
    width: 6px;
}

.user-match-history::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.user-match-history::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 3px;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.history-opponent {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.history-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--surface);
}

.history-details {
    flex: 1;
}

.history-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.history-date {
    font-size: 11px;
    color: var(--text-secondary);
}

.history-result {
    text-align: right;
}

.history-outcome {
    font-size: 13px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 8px;
    margin-bottom: 4px;
}

.history-outcome.won {
    background: rgba(74, 222, 128, 0.2);
    color: var(--success);
}

.history-outcome.lost {
    background: rgba(255, 107, 122, 0.2);
    color: var(--accent-coral);
}

.history-points {
    font-size: 12px;
    color: var(--text-secondary);
}

@media (min-width: 600px) {
    .app-container {
        box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
    }
}

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

    .stat-card-horizontal {
        padding: 14px;
    }

    .stat-icon {
        font-size: 28px;
    }
}

/* Prevent pull-to-refresh on mobile */
body {
    overscroll-behavior-y: contain;
}

/* Analytics View */
.analytics-container {
    padding: 30px 20px 40px;
}

.analytics-header {
    text-align: center;
    margin-bottom: 32px;
}

.analytics-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.analytics-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Global Stats Section */
.global-stats-section {
    margin-bottom: 32px;
}

.section-title-small {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

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

.stat-icon-large {
    font-size: 40px;
    line-height: 1;
}

.divider-line {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    margin: 32px 0;
}

.player-analytics-section {
    margin-top: 32px;
}

.player-selector {
    margin-bottom: 32px;
}

.player-selector label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-secondary);
}

.analytics-select {
    width: 100%;
    padding: 16px;
    background: rgba(19, 47, 76, 0.6);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.analytics-select:focus {
    outline: none;
    border-color: var(--secondary-color);
    background: rgba(19, 47, 76, 0.8);
}

.analytics-select option {
    background: var(--surface);
    color: var(--text-primary);
    padding: 10px;
}

.analytics-content {
    min-height: 400px;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Analytics Stats Grid */
.analytics-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.analytics-stat-card {
    background: rgba(19, 47, 76, 0.6);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.analytics-stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 8px;
}

.analytics-stat-card .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Head-to-Head Section */
.h2h-section {
    margin-bottom: 32px;
}

.section-header {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-icon {
    font-size: 24px;
}

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

.h2h-item {
    background: rgba(19, 47, 76, 0.6);
    backdrop-filter: blur(10px);
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.h2h-opponent {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.h2h-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--surface);
}

.h2h-info {
    flex: 1;
}

.h2h-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.h2h-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.h2h-stats {
    text-align: right;
}

.h2h-record {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.h2h-record.positive {
    color: var(--success);
}

.h2h-record.negative {
    color: var(--accent-coral);
}

.h2h-record.neutral {
    color: var(--text-secondary);
}

.h2h-games {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Performance Chart */
.performance-chart {
    background: rgba(19, 47, 76, 0.6);
    backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 32px;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 200px;
    margin-top: 20px;
}

.chart-bar {
    flex: 1;
    background: linear-gradient(180deg, var(--secondary-color), var(--accent-purple));
    border-radius: 8px 8px 0 0;
    position: relative;
    transition: all 0.3s ease;
    min-height: 20px;
}

.chart-bar:hover {
    opacity: 0.8;
    transform: scaleY(1.05);
}

.chart-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.chart-value {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 480px) {
    .leaderboard-item {
        padding: 16px;
    }

    .leaderboard-rank {
        font-size: 16px;
        min-width: 28px;
        padding: 6px 10px;
    }

    .leaderboard-avatar {
        width: 48px;
        height: 48px;
    }

    .leaderboard-name {
        font-size: 15px;
    }

    .player-badge {
        font-size: 10px;
        padding: 2px 8px;
    }

    .leaderboard-stats {
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }

    .leaderboard-score {
        font-size: 20px;
    }

    .leaderboard-winrate {
        font-size: 16px;
    }

    .analytics-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Chess Clock Styles */
.clock-container {
    padding: 30px 20px;
    min-height: calc(100vh - 84px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.clock-title {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 32px;
    color: var(--text-primary);
}

.clock-settings {
    max-width: 450px;
    margin: 0 auto;
    width: 100%;
}

.setting-group {
    margin-bottom: 24px;
}

.setting-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.clock-select {
    width: 100%;
    padding: 14px 16px;
    background: rgba(19, 47, 76, 0.6);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clock-select:focus {
    outline: none;
    border-color: var(--secondary-color);
    background: rgba(19, 47, 76, 0.8);
}

.clock-select option {
    background: var(--surface);
    color: var(--text-primary);
    padding: 10px;
}

.custom-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(19, 47, 76, 0.6);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.custom-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    background: rgba(19, 47, 76, 0.8);
}

/* Clock Display */
.clock-display {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
    padding-bottom: 20px;
}

.clock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding: 0 10px;
}

.clock-control-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(19, 47, 76, 0.6);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.clock-control-btn:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: scale(1.1);
}

.clock-control-btn:active {
    transform: scale(1.05);
}

.clock-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
}

.clock-separator {
    opacity: 0.5;
}

/* Player Clocks */
.clocks-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
    flex: 1;
}

.player-clock {
    background: rgba(19, 47, 76, 0.4);
    backdrop-filter: blur(20px);
    border: 4px solid rgba(255, 255, 255, 0.15);
    border-radius: 28px;
    padding: 40px 32px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    flex: 1;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.player-clock::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--secondary-color), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.player-clock::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.player-clock:hover::before {
    opacity: 0.15;
}

.player-clock:active::after {
    opacity: 1;
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    from {
        transform: scale(0);
        opacity: 1;
    }
    to {
        transform: scale(1);
        opacity: 0;
    }
}

.player-clock.active {
    background: linear-gradient(135deg, #14532d 0%, #052e16 100%);
    border-color: #22c55e;
    box-shadow: 0 0 60px rgba(34, 197, 94, 0.2), 0 12px 32px rgba(0, 0, 0, 0.5);
    animation: pulse 2s ease-in-out infinite;
    transform: scale(1.02);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 60px rgba(34, 197, 94, 0.2), 0 12px 32px rgba(0, 0, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 80px rgba(34, 197, 94, 0.35), 0 16px 40px rgba(0, 0, 0, 0.6);
    }
}

.player-clock.active::before {
    opacity: 0.1;
    background: radial-gradient(circle at top right, #4ade80, transparent 70%);
}

/* Warning States */
.player-clock.warning {
    border-color: #eab308;
    box-shadow: 0 0 60px rgba(234, 179, 8, 0.4);
    animation: pulseWarning 1.5s ease-in-out infinite;
}

@keyframes pulseWarning {
    0%, 100% {
        box-shadow: 0 0 60px rgba(234, 179, 8, 0.4);
    }
    50% {
        box-shadow: 0 0 80px rgba(234, 179, 8, 0.6);
    }
}

.player-clock.danger {
    border-color: #ef4444;
    box-shadow: 0 0 60px rgba(239, 68, 68, 0.5);
    animation: pulseDanger 1s ease-in-out infinite;
}

@keyframes pulseDanger {
    0%, 100% {
        box-shadow: 0 0 60px rgba(239, 68, 68, 0.5);
    }
    50% {
        box-shadow: 0 0 90px rgba(239, 68, 68, 0.7);
    }
}

.player-clock.critical {
    border-color: #dc2626;
    box-shadow: 0 0 80px rgba(220, 38, 38, 0.6);
    animation: pulseCritical 0.5s ease-in-out infinite;
}

@keyframes pulseCritical {
    0%, 100% {
        box-shadow: 0 0 80px rgba(220, 38, 38, 0.6);
        transform: scale(1.02);
    }
    50% {
        box-shadow: 0 0 100px rgba(220, 38, 38, 0.8);
        transform: scale(1.04);
    }
}

.player-clock.expired {
    border-color: var(--error);
    box-shadow: 0 0 60px rgba(239, 68, 68, 0.5);
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
    20%, 40%, 60%, 80% { transform: translateX(8px); }
}

.player-label {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.time-display {
    font-size: 80px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    text-align: center;
    margin: 24px 0;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
    letter-spacing: -3px;
    line-height: 1;
}

.player-clock.active .time-display {
    color: var(--secondary-color);
    text-shadow: 0 4px 24px rgba(245, 158, 66, 0.6);
}

.player-clock.warning .time-display {
    color: #eab308;
    text-shadow: 0 4px 24px rgba(234, 179, 8, 0.6);
}

.player-clock.danger .time-display {
    color: #ef4444;
    text-shadow: 0 4px 24px rgba(239, 68, 68, 0.6);
}

.player-clock.critical .time-display {
    color: #dc2626;
    text-shadow: 0 4px 24px rgba(220, 38, 38, 0.6);
    animation: flashText 0.5s ease-in-out infinite;
}

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

.player-clock.expired .time-display {
    color: var(--error);
}

.clock-status {
    font-size: 15px;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 600;
    margin-top: 8px;
}

.player-clock.active .clock-status {
    color: var(--secondary-color);
}

.player-clock.warning .clock-status,
.player-clock.danger .clock-status,
.player-clock.critical .clock-status {
    color: #eab308;
}

.time-warning {
    font-size: 13px;
    font-weight: 700;
    color: #eab308;
    text-align: center;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.player-clock.warning .time-warning,
.player-clock.danger .time-warning,
.player-clock.critical .time-warning {
    opacity: 1;
}

.clock-divider {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: -10px 0;
    position: relative;
    z-index: 10;
}

.vs-badge {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-coral));
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 4px solid var(--background);
}

/* Removed back-to-settings */

/* Responsive Clock */
@media (max-width: 480px) {
    .time-display {
        font-size: 64px;
    }
    
    .player-clock {
        padding: 32px 24px;
        min-height: 220px;
    }
    
    .clock-control-btn {
        width: 44px;
        height: 44px;
    }
    
    .vs-badge {
        width: 50px;
        height: 50px;
        font-size: 16px;
    }
    
    .clock-display {
        height: 100vh;
        padding-top: 60px;
    }
}

/* Performance Optimizations */
.player-clock, .time-display, .floating-exit-btn, .clock-control-btn {
    will-change: transform, opacity;
    transform: translateZ(0); /* Force GPU acceleration */
    backface-visibility: hidden;
}

.player-clock {
    will-change: transform, box-shadow; /* Box shadow is heavy, but necessary here */
}

/* Clock Animations */
@keyframes tickPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); color: var(--error); }
    100% { transform: scale(1); }
}

/* Admin Styles */
.admin-container {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    padding: 20px;
}

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

.admin-tabs {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--surface);
    padding-bottom: 2px;
}

.admin-tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    position: relative;
    transition: all 0.3s ease;
}

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

.admin-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--secondary-color);
    border-radius: 3px;
}

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

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

.admin-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-item {
    background: rgba(19, 47, 76, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.admin-item-info {
    flex: 1;
}

.admin-item-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.admin-item-subtitle {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.admin-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--primary-color);
    color: white;
}

.btn-icon.delete:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

@media (max-width: 600px) {
    .admin-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .admin-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Record Match Popup Styles */
div:where(.swal2-container) .record-match-popup {
    background: #0f2744 !important;
    border-radius: 24px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 24px !important;
}

.record-match-container {
    text-align: left;
    padding: 10px;
}

.step-title {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Opponents Grid */
.opponents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Scrollbar for grid */
.opponents-grid::-webkit-scrollbar {
    width: 6px;
}
.opponents-grid::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.opponent-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.opponent-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.opponent-card.selected {
    background: rgba(245, 158, 66, 0.1);
    border-color: var(--secondary-color);
}

.opponent-card.selected .check-mark {
    display: flex;
}

.opponent-avatar-wrapper {
    position: relative;
    margin-bottom: 10px;
}

.opponent-card-avatar {
    width: 56px !important;
    height: 56px !important;
    min-width: 56px;
    min-height: 56px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.opponent-card.selected .opponent-card-avatar {
    border-color: var(--secondary-color);
}

.opponent-card-name {
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.opponent-card-score {
    color: var(--secondary-color);
    font-size: 12px;
    font-weight: 500;
}

.check-mark {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: var(--secondary-color);
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Match Details Section */
.match-details-section {
    background: rgba(0, 0, 0, 0.2);
    padding: 16px;
    border-radius: 16px;
    margin-top: 20px;
}

.input-group-custom label {
    display: block;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
}

.custom-swal-input {
    width: 100% !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    border-radius: 12px !important;
    padding: 12px !important;
    margin: 0 !important;
    font-size: 16px !important;
    box-shadow: none !important;
    transition: all 0.3s ease;
}

.custom-swal-input:focus {
    border-color: var(--secondary-color) !important;
    background: rgba(255, 255, 255, 0.12) !important;
}

/* SweetAlert buttons override */
div:where(.swal2-container) .btn-record-confirm {
    background: linear-gradient(135deg, var(--secondary-color), #e8893c) !important;
    color: white !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    padding: 12px 32px !important;
    box-shadow: 0 4px 15px rgba(245, 158, 66, 0.3) !important;
}

/* Mobile Record Match Popup Styles */
div:where(.swal2-container) .mobile-match-popup {
    background: #0f2744 !important;
    border-radius: 20px 20px 0 0 !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    align-self: flex-end !important;
    width: 100% !important;
    max-width: 100% !important;
    animation: slideUp 0.3s ease-out !important;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.4) !important;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

div:where(.swal2-container) .swal2-title {
    padding: 20px 20px 10px !important;
    font-size: 20px !important;
    color: white !important;
    text-align: left !important;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.match-popup-content {
    padding: 20px;
}

.match-step {
    margin-bottom: 24px;
}

.match-label {
    display: block;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}

/* Horizontal Scroll Container (Stories Style) */
.opponents-scroll-container {
    display: flex;
    overflow-x: auto;
    gap: 16px;
    padding-bottom: 10px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE */
    mask-image: linear-gradient(to right, black 90%, transparent 100%);
}

.opponents-scroll-container::-webkit-scrollbar {
    display: none;
}

.opponent-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.opponent-item:active {
    transform: scale(0.95);
}

.opponent-avatar-container {
    padding: 3px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.1);
    position: relative;
    transition: all 0.2s;
}

.opponent-item.selected .opponent-avatar-container {
    border-color: var(--secondary-color);
    background: rgba(245, 158, 66, 0.1);
}

.opponent-img {
    width: 60px !important;
    height: 60px !important;
    max-width: 60px !important;
    min-width: 60px !important;
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface);
    display: block;
}

.opponent-item.selected .opponent-img {
    opacity: 0.8;
}

.opponent-check {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--secondary-color);
    color: white;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid #0f2744;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.opponent-item.selected .opponent-check {
    opacity: 1;
    transform: scale(1);
}

.opponent-name-label {
    font-size: 12px;
    color: var(--text-secondary);
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.opponent-item.selected .opponent-name-label {
    color: white;
    font-weight: 600;
}

/* Moves Input */
.moves-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 4px;
    border: 1px solid rgba(255,255,255,0.1);
}

.move-btn {
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    border-radius: 8px;
}

.move-btn:active {
    background: rgba(255,255,255,0.1);
}

.moves-number-input {
    flex: 1;
    background: transparent;
    border: none;
    text-align: center;
    color: white;
    font-size: 20px;
    font-weight: 700;
    appearance: none;
    -moz-appearance: textfield;
}

.moves-number-input::-webkit-inner-spin-button { 
    -webkit-appearance: none; 
}

.moves-number-input:focus {
    outline: none;
}

div:where(.swal2-actions) {
    padding: 0 20px 30px !important;
    margin: 0 !important;
    gap: 12px;
}

div:where(.swal2-container) .btn-record-confirm {
    margin: 0 !important;
    width: 100% !important;
    background: var(--secondary-color) !important; 
    color: white !important;
    box-shadow: none !important;
    padding: 14px !important;
}

/* New Match Summary Card Design */
.match-item-new {
    background: rgba(19, 47, 76, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideInRight 0.4s ease backwards;
}

.match-summary-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.match-result-line {
    font-size: 15px;
    color: white;
}

.winner-name {
    font-weight: 700;
    color: var(--secondary-color);
}

.match-action {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0 4px;
}

.loser-name {
    font-weight: 600;
    color: white; /* Or a muted color if preferred */
}

.match-meta-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.match-time-new {
    font-size: 11px;
    color: var(--text-secondary);
}

.moves-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.08);
    padding: 3px 8px;
    border-radius: 6px;
}

.chess-pawn-icon {
    font-size: 10px;
    color: var(--secondary-color);
}

.moves-count {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Majestic Match Card Updates */
.match-result-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
}

.player-mini {
    display: flex;
    align-items: center;
    gap: 6px;
}

.avatar-mini {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.2);
    background: var(--surface);
}

.match-vs-label {
    color: var(--text-secondary);
    font-size: 12px;
    font-style: italic;
    opacity: 0.7;
    margin: 0 2px;
}

/* Update spacing for the points badge */
.match-points-badge {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.2), rgba(34, 197, 94, 0.2));
    border: 1px solid rgba(74, 222, 128, 0.3);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    color: #4ade80;
    font-family: 'Righteous', cursive;
    letter-spacing: 0.5px;
}