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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #a855f7;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--gray-900);
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.loading-screen.active {
    display: flex;
}

.loading-content {
    text-align: center;
    animation: slideUp 0.5s ease-out;
}

.loading-logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: pulse 2s ease-in-out infinite;
}

.loading-logo svg {
    stroke: white;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    }
}

.loading-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.spinner-ring {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite;
}

.spinner-ring:nth-child(1) {
    animation-delay: 0s;
}

.spinner-ring:nth-child(2) {
    animation-delay: 0.2s;
}

.spinner-ring:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Screen Management */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Login Screen */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    animation: fadeIn 0.3s ease-out;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-circle {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
    color: white;
}

.login-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--gray-600);
    font-size: 0.875rem;
}

#emailLoginForm input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 0.75rem;
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: all 0.2s;
}

#emailLoginForm input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

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

.btn-text {
    width: 100%;
    padding: 0.5rem;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-text:hover {
    text-decoration: underline;
}

.divider {
    position: relative;
    text-align: center;
    margin: 1.5rem 0;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gray-300);
}

.divider span {
    position: relative;
    background: white;
    padding: 0 0.5rem;
    color: var(--gray-600);
    font-size: 0.875rem;
}

.btn-google {
    width: 100%;
    padding: 0.875rem;
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.2s;
}

.btn-google:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* App Screen */
.app-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-logo {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 0.5rem;
    border-radius: 0.75rem;
}

.header-left h1 {
    font-size: 1.25rem;
    font-weight: 700;
}

.header-left p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
}

.btn-icon {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.75rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Main Content */
.main-content {
    max-width: 1024px;
    margin: 0 auto;
    padding: 1rem 1rem 6rem;
    min-height: calc(100vh - 80px);
    background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 100%);
}

/* Stats Grid - Mobile First */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.stat-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--gray-600);
}

.stat-header svg {
    stroke: var(--primary);
    flex-shrink: 0;
}

.stat-header span {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
}

/* Section Card */
.section-card {
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.section-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Leaderboard */
.leaderboard-list {
    padding: 1rem;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
    cursor: pointer;
}

.leaderboard-item:hover {
    transform: translateY(-2px);
}

.leaderboard-item.rank-1 {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #fbbf24;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.leaderboard-item.rank-2 {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border: 2px solid #9ca3af;
}

.leaderboard-item.rank-3 {
    background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
    border: 2px solid #fb923c;
}

.leaderboard-item.rank-other {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
}

.rank-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.rank-1 .rank-badge {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
}

.rank-2 .rank-badge {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
    color: white;
}

.rank-3 .rank-badge {
    background: linear-gradient(135deg, #fb923c, #f97316);
    color: white;
}

.rank-other .rank-badge {
    background: var(--gray-300);
    color: var(--gray-700);
}

.player-info {
    flex: 1;
    min-width: 0;
}

.player-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-stats {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.7rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
}

.win-rate {
    text-align: right;
    flex-shrink: 0;
}

.win-rate-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.win-rate.high {
    color: var(--success);
}

.win-rate.medium {
    color: var(--primary);
}

.win-rate.low {
    color: var(--warning);
}

.win-rate-label {
    font-size: 0.65rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
}

/* Matches List */
.matches-list {
    padding: 1rem;
}

.match-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: white;
    border-radius: 1rem;
    margin-bottom: 0.75rem;
    border: 2px solid var(--gray-100);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.2s;
}

.match-item:hover {
    transform: translateX(4px);
    border-color: var(--gray-200);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.match-info {
    flex: 1;
    min-width: 0;
}

.match-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
}

.match-winner {
    font-weight: 700;
    color: var(--success);
    font-size: 0.9rem;
}

.match-vs {
    color: var(--gray-400);
    font-weight: 600;
    font-size: 0.75rem;
}

.match-loser {
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.9rem;
}

.match-score {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 0.25rem;
}

.match-meta {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.match-date {
    font-size: 0.7rem;
    color: var(--gray-500);
}

.match-time {
    font-size: 0.65rem;
    color: var(--gray-400);
}

/* Analytics Section - Improved for mobile */
.analytics-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.analytics-card {
    background: white;
    border-radius: 1.25rem;
    padding: 1.25rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.analytics-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--primary);
}

.analytics-icon {
    font-size: 2rem;
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gray-50), var(--gray-100));
    border-radius: 1rem;
}

.analytics-content {
    flex: 1;
    min-width: 0;
}

.analytics-label {
    font-size: 0.75rem;
    color: var(--gray-600);
    font-weight: 500;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analytics-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 99;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.5);
}

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

/* Footer */
.app-footer {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    text-align: center;
    padding: 1.5rem 1rem;
    margin-top: auto;
    font-size: 0.875rem;
    font-weight: 500;
}

.app-footer p {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.heart-icon {
    display: inline-block;
    animation: heartbeat 1.5s ease-in-out infinite;
    font-size: 1.1em;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    10%, 30% {
        transform: scale(1.1);
    }
    20%, 40% {
        transform: scale(1);
    }
}

/* Modal - Completely Redesigned */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.modal-content-new {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 2rem;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.btn-close-new {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--gray-100);
    color: var(--gray-700);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.btn-close-new:hover {
    background: var(--danger);
    color: white;
    transform: rotate(90deg) scale(1.1);
}

.modal-hero {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--gray-100);
}

.trophy-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 2s ease-in-out infinite;
}

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

.modal-title-new {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.modal-subtitle {
    font-size: 1rem;
    color: var(--gray-600);
    font-weight: 500;
}

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

.section-header-new {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.section-icon {
    font-size: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-header-new h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

/* New Opponents Grid */
.opponents-wrapper {
    position: relative;
}

.opponents-grid-new {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    max-height: 240px;
    overflow-y: auto;
    padding: 0.5rem;
    margin: 0 -0.5rem;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.opponents-grid-new:hover {
    scrollbar-color: var(--primary) transparent;
}

.opponents-grid-new::-webkit-scrollbar {
    width: 4px;
}

.opponents-grid-new::-webkit-scrollbar-track {
    background: transparent;
}

.opponents-grid-new::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.opponents-grid-new:hover::-webkit-scrollbar-thumb {
    opacity: 1;
}

.opponents-grid-new::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.scroll-hint {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    animation: bounceHint 2s ease-in-out infinite;
    pointer-events: none;
}

.scroll-hint.visible {
    display: flex;
}

@keyframes bounceHint {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(8px);
    }
}

.opponent-card {
    background: white;
    border: 3px solid var(--gray-200);
    border-radius: 1.25rem;
    padding: 1rem 0.75rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
    position: relative;
    overflow: visible;
}

.opponent-card:hover {
    transform: translateY(-8px) scale(1.05);
    border-color: var(--primary);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.3);
}

.opponent-card.selected {
    background: linear-gradient(135deg, #eef2ff 0%, #ddd6fe 100%);
    border-color: var(--primary);
    border-width: 3px;
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.4);
    transform: translateY(-4px) scale(1.02);
}

.opponent-avatar {
    width: 52px;
    height: 52px;
    margin: 0 auto 0.75rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    transition: all 0.3s ease;
    border: 3px solid white;
}

.opponent-card:hover .opponent-avatar {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 8px 28px rgba(99, 102, 241, 0.5);
}

.opponent-card.selected .opponent-avatar {
    transform: scale(1.1);
    box-shadow: 0 8px 28px rgba(99, 102, 241, 0.6);
}

.opponent-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    text-align: center;
}

.opponent-card.selected .opponent-name {
    color: var(--primary);
}

.opponent-checkmark {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--success), #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0) rotate(-180deg);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    border: 3px solid white;
}

.opponent-card.selected .opponent-checkmark {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.opponent-checkmark svg {
    width: 14px;
    height: 14px;
    stroke: white;
    stroke-width: 3;
}

/* New Score Container */
.score-container-new {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #f0fdf4 100%);
    border-radius: 1.5rem;
    border: 2px solid #e0f2fe;
}

.player-score-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.player-score-card.winner-card {
    position: relative;
}

.player-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crown-icon {
    font-size: 1.2rem;
    animation: wiggle 2s ease-in-out infinite;
}

@keyframes wiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-15deg);
    }
    75% {
        transform: rotate(15deg);
    }
}

.score-input-new {
    width: 100%;
    height: 80px;
    padding: 0;
    border: 3px solid var(--gray-200);
    border-radius: 1.25rem;
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    font-family: inherit;
    background: white;
    color: var(--gray-900);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.score-input-new:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
}

.score-input-new:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), 0 8px 24px rgba(99, 102, 241, 0.2);
    transform: translateY(-4px);
}

.vs-divider-new {
    display: flex;
    align-items: center;
    justify-content: center;
}

.vs-circle {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    color: white;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
    border: 4px solid white;
    animation: pulse 2s ease-in-out infinite;
}

/* Submit Button */
.btn-submit-new {
    width: 100%;
    height: 64px;
    background: white;
    border: 3px solid #e5e7eb;
    border-radius: 1.5rem;
    color: #111827;
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-submit-new::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, 
        transparent 0%,
        rgba(99, 102, 241, 0.1) 25%,
        rgba(168, 85, 247, 0.1) 50%,
        rgba(236, 72, 153, 0.1) 75%,
        transparent 100%
    );
    animation: shimmer 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.btn-submit-new:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--primary);
}

.btn-submit-new:active:not(:disabled) {
    transform: translateY(0);
    transition: all 0.1s ease;
}

.btn-submit-new:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    background: #f3f4f6;
    color: #9ca3af;
}

.btn-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    transition: all 0.3s ease;
}

.btn-submit-new:hover:not(:disabled) .btn-icon-wrapper {
    transform: scale(1.1);
}

.btn-icon-wrapper svg {
    stroke: white;
}

.btn-text {
    font-weight: 800;
    color: #111827;
}

.btn-shine {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .modal-content-new {
        padding: 1.5rem;
    }
    
    .modal-title-new {
        font-size: 1.75rem;
    }
    
    .trophy-icon {
        font-size: 3rem;
    }
    
    .score-container-new {
        gap: 1rem;
        padding: 1rem;
    }
    
    .score-input-new {
        height: 70px;
        font-size: 2rem;
    }
    
    .vs-circle {
        width: 48px;
        height: 48px;
        font-size: 0.875rem;
    }
    
    .btn-submit-new {
        height: 56px;
        font-size: 1.1rem;
    }
}

/* Confetti Canvas */
#confettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.opponents-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.opponent-item {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 0.75rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
    text-align: left;
}

.opponent-item:hover {
    border-color: var(--primary);
}

.opponent-item.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.opponent-name {
    font-weight: 600;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.opponent-stats {
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
}

.btn-full {
    width: 100%;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* Responsive Design - Mobile First Approach */
@media (min-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .rank-badge {
        width: 40px;
        height: 40px;
        font-size: 1.125rem;
    }
    
    .player-name {
        font-size: 1rem;
    }
    
    .player-stats {
        font-size: 0.75rem;
    }
    
    .win-rate-value {
        font-size: 1.5rem;
    }
    
    .match-winner,
    .match-loser {
        font-size: 1rem;
    }
    
    .match-vs {
        font-size: 0.875rem;
    }
    
    .match-score {
        font-size: 0.875rem;
    }
    
    .match-date {
        font-size: 0.75rem;
    }
    
    .match-time {
        font-size: 0.75rem;
    }
    
    .fab {
        width: 64px;
        height: 64px;
    }
    
    .analytics-value {
        font-size: 1.5rem;
    }
    
    .analytics-label {
        font-size: 0.8rem;
    }
}

@media (min-width: 640px) {
    .modal-content {
        border-radius: 1.5rem;
        align-self: center;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .main-content {
        padding: 1.5rem 1rem 6rem;
    }
    
    .analytics-section {
        gap: 1.25rem;
    }
    
    .analytics-card {
        padding: 1.5rem;
    }
}

@media (min-width: 768px) {
    .login-card {
        padding: 2.5rem;
    }
    
    .header-left h1 {
        font-size: 1.5rem;
    }
    
    .header-left p {
        font-size: 0.875rem;
    }
    
    .section-header {
        padding: 1.25rem 1.5rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .leaderboard-item {
        gap: 1rem;
    }
    
    .match-item {
        padding: 1.25rem;
    }
}

/* Landscape orientation optimizations */
@media (max-height: 600px) and (orientation: landscape) {
    .login-card {
        padding: 1.5rem;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .logo-circle {
        width: 60px;
        height: 60px;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
    }
    
    .modal-content {
        max-height: 85vh;
    }
}