:root {
    --bg-primary: #0F0F0F;
    --bg-secondary: #1E1E1E;
    --bg-tertiary: #262626;
    --accent: #FFAB40; /* Orange Accent */
    --accent-light: #FFD180;
    --text-primary: #FFFFFF;
    --text-secondary: #B0B0B0;
    --text-muted: #666666;
    --success: #00E676;
    --error: #FF5252;
    --info: #2979FF;
    --glass-bg: rgba(30, 30, 30, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* 🚀 Splash Screen Overlay */
#splash-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s;
}

#splash-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.splash-logo {
    width: 140px;
    height: 140px;
    object-fit: contain;
    animation: splashPulse 2s infinite ease-in-out;
}

@keyframes splashPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 5px rgba(255,171,64,0.1)); }
    50% { transform: scale(1.08); filter: drop-shadow(0 0 25px rgba(255,171,64,0.4)); }
}

.splash-text {
    margin-top: 2rem;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 5px;
    color: #fff;
    text-transform: uppercase;
    opacity: 0.8;
}

.splash-loader {
    margin-top: 2rem;
    width: 50px;
    height: 2px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.splash-loader::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--accent);
    animation: loaderMove 1.5s infinite linear;
}

@keyframes loaderMove {
    0% { left: -100%; }
    100% { left: 100%; }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.4;
    overflow-x: hidden;
    font-size: 14px;
}

/* Glassmorphism Classes */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

/* Overlays */
.overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--bg-primary);
    display: flex;
    justify-content: center;
    align-items: center;
}

.hidden {
    display: none !important;
}

/* Auth Container */
.auth-container {
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.auth-header h1 {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 0.25rem;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.auth-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
    border-radius: 20px;
}

.input-group {
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    transition: all 0.3s ease;
}

.input-group:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(255, 171, 64, 0.2);
}

.input-group span {
    color: var(--text-muted);
    font-size: 1.2rem;
}

.input-group input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    padding: 1rem;
    width: 100%;
    font-family: 'Inter', sans-serif;
}

.primary-btn {
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 12px;
    padding: 1rem;
    width: 100%;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 1rem;
}

.primary-btn:active {
    transform: scale(0.98);
}

.auth-footer {
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

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

/* Header & Nav */
.main-header {
    height: 60px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 0.5rem 1.25rem;
    display: flex;
    align-items: center;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.avatar {
    width: 36px;
    height: 36px;
    background: var(--accent);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    color: #000;
    font-size: 0.9rem;
}

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

.user-info h2 {
    font-size: 1rem;
    font-weight: 700;
}

.user-info span {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wallet-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-weight: 700;
}

.bottom-nav {
    height: 50px;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--glass-border);
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.55rem;
    font-weight: 500;
    gap: 1px;
    transition: color 0.3s ease;
    flex: 1;
}

.nav-item.active {
    color: var(--accent);
}

.nav-item span {
    font-size: 1rem;
}

/* Main Content */
main {
    padding: 75px 1rem 70px;
    min-height: 100vh;
}

/* Tournament Cards */
.card {
    background: var(--bg-secondary);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.card-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.card-body {
    padding: 1.25rem;
}

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

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 800;
    background: rgba(255, 171, 64, 0.1);
    color: var(--accent);
}

.meta-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.divider {
    height: 1px;
    background: var(--glass-border);
    margin: 1rem 0;
}

.stats-grid {
    display: flex;
    justify-content: space-between;
}

.stat-item p {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
}

.stat-item h3 {
    font-size: 0.95rem;
    font-weight: 700;
}

/* Loader */
.loader-container {
    height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
}

.loader {
    width: 48px;
    height: 48px;
    border: 3px solid var(--bg-secondary);
    border-bottom-color: var(--accent);
    border-radius: 50%;
    display: inline-block;
    animation: rotation 1s linear infinite;
    margin-bottom: 1.5rem;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tabs */
.tabs-container {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
}

.tab {
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    transition: all 0.2s;
}

.tab.active {
    background: var(--accent);
    color: #000;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 1.5rem;
}

.modal {
    width: 100%;
    max-width: 500px;
    border-radius: 24px;
    padding: 2rem;
    max-height: 90vh;
    overflow-y: auto;
}

/* Utility */
.accent-text { color: var(--accent); }
.success-text { color: var(--success); }
.pulse { animation: pulse 2s infinite; }

/* Shimmer Loading Effect */
.shimmer {
    background: linear-gradient(
        90deg, 
        rgba(255, 255, 255, 0.03) 25%, 
        rgba(255, 255, 255, 0.08) 50%, 
        rgba(255, 255, 255, 0.03) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.shimmer-card {
    height: 300px;
    margin-bottom: 1rem;
}

.shimmer-img { height: 140px; margin-bottom: 12px; }
.shimmer-title { height: 24px; width: 60%; margin-bottom: 12px; }
.shimmer-bar { height: 16px; width: 40%; margin-bottom: 24px; }
.shimmer-btn { height: 44px; width: 100%; border-radius: 12px; }

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 171, 64, 0.3); }
    70% { box-shadow: 0 0 0 8px rgba(255, 171, 64, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 171, 64, 0); }
}

/* Leaderboard Fullscreen & Podium */
.fullscreen-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: 3000;
    overflow-y: auto;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
}

.celebration-bg {
    background: linear-gradient(135deg, #0F0F0F, #1A0D00, #0F0F0F);
    background-size: 200% 200%;
    animation: celebrateGradient 4s infinite linear;
}

@keyframes celebrateGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 10px;
    margin: 2rem 0;
    min-height: 180px;
}

.podium-item {
    flex: 1;
    max-width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    animation: slideUp 0.6s ease-out;
}

.podium-rank {
    position: absolute;
    top: -15px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    font-size: 0.8rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    border: 2px solid rgba(255,255,255,0.2);
}

.rank-1 { background: linear-gradient(135deg, #FFD700, #B8860B); color: #000; scale: 1.15; z-index: 2; }
.rank-2 { background: linear-gradient(135deg, #C0C0C0, #808080); color: #000; }
.rank-3 { background: linear-gradient(135deg, #CD7F32, #8B4513); color: #000; }

.podium-pillar {
    width: 100%;
    border-radius: 12px 12px 0 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.1), transparent);
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-bottom: 0.75rem;
    text-align: center;
}

.p-height-1 { height: 140px; }
.p-height-2 { height: 100px; }
.p-height-3 { height: 80px; }

.podium-name {
    font-weight: 700;
    font-size: 0.65rem;
    color: #fff;
    margin-bottom: 0.25rem;
    padding: 0 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.podium-stats {
    font-size: 0.6rem;
    color: var(--accent);
    font-weight: 800;
}

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

/* Rest of participant list in leaderboard */
.lb-list-header {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 10px;
    margin-top: 2rem;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
}
/* Success Animation */
.success-checkmark {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    position: relative;
}

.check-icon {
    width: 80px;
    height: 80px;
    position: relative;
    border-radius: 50%;
    box-sizing: content-box;
    border: 4px solid var(--success);
}

.check-icon::before {
    content: '';
    position: absolute;
    top: 3px;
    left: -2px;
    width: 30px;
    transform-origin: 100% 50%;
    border-radius: 100px 0 0 100px;
}

.check-icon::after {
    content: '';
    position: absolute;
    top: 0;
    left: 30px;
    width: 60px;
    transform-origin: 0 50%;
    border-radius: 0 100px 100px 0;
    animation: rotatePlaceholder 4.25s ease-in;
}

.check-icon .icon-line {
    height: 5px;
    background-color: var(--success);
    display: block;
    border-radius: 2px;
    position: absolute;
    z-index: 10;
}

.check-icon .icon-line.line-tip {
    top: 46px;
    left: 14px;
    width: 25px;
    transform: rotate(45deg);
    animation: icon-line-tip 0.75s;
}

.check-icon .icon-line.line-long {
    top: 38px;
    right: 8px;
    width: 47px;
    transform: rotate(-45deg);
    animation: icon-line-long 0.75s;
}

.check-icon .icon-circle {
    top: -4px;
    left: -4px;
    z-index: 10;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid rgba(0, 230, 118, 0.2);
    box-sizing: content-box;
    position: absolute;
}

@keyframes icon-line-tip {
    0% { width: 0; left: 1px; top: 19px; }
    54% { width: 0; left: 1px; top: 19px; }
    70% { width: 50px; left: -8px; top: 37px; }
    84% { width: 17px; left: 21px; top: 48px; }
    100% { width: 25px; left: 14px; top: 46px; }
}

@keyframes icon-line-long {
    0% { width: 0; right: 46px; top: 54px; }
    65% { width: 0; right: 46px; top: 54px; }
    84% { width: 55px; right: 0px; top: 35px; }
    100% { width: 47px; right: 8px; top: 38px; }
}

@keyframes rotatePlaceholder {
    0% { transform: rotate(-45deg); }
    5% { transform: rotate(-45deg); }
    12% { transform: rotate(-405deg); }
    100% { transform: rotate(-405deg); }
}

.animate-modal {
    animation: modalScaleIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

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

/* --- Added Overlay Fixes --- */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
    background: var(--bg-primary);
    overflow-y: auto;
    padding-bottom: 100px;
}

.celebration-bg {
    background: radial-gradient(circle at top, rgba(255,171,64,0.15), var(--bg-primary)) !important;
}

.animate-in {
    animation: slideUp 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

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