/* ==========================================
   FGD Coupe du Monde 2026 - Styles
   Mobile-first, RTL Arabic
   ========================================== */

/* ---- CSS Variables ---- */
:root {
    --primary: #c8a415;
    --primary-dark: #a6880e;
    --primary-light: #e6c229;
    --primary-glow: rgba(200, 164, 21, 0.3);
    --secondary: #0d6e2d;
    --secondary-light: #15a044;
    --accent: #e63946;
    --accent-light: #ff6b7a;

    --bg-dark: #0a0f1a;
    --bg-card: #111827;
    --bg-card-hover: #1a2332;
    --bg-surface: #1e293b;
    --bg-surface-light: #273548;

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-on-primary: #1a1000;

    --border: #1e293b;
    --border-light: #334155;

    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 50px;

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 20px var(--primary-glow);

    --nav-height: 60px;
    --bottom-nav-height: 64px;

    --font: 'Noto Kufi Arabic', 'Segoe UI', Tahoma, sans-serif;
}

/* ---- Reset ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg-dark);
    color: var(--text-primary);
    direction: rtl;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover { color: var(--secondary); }

img { max-width: 100%; height: auto; }

/* ---- Background Pattern ---- */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 0%, rgba(200, 164, 21, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(200, 164, 21, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ---- Navigation ---- */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 15, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    height: var(--nav-height);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: var(--nav-height);
    max-width: 600px;
    margin: 0 auto;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo {
    font-size: 28px;
    animation: bounce 2s ease infinite;
}

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

.nav-title {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.nav-app-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
}

.nav-org {
    font-size: 10px;
    color: var(--primary-light);
    font-weight: 500;
}

.nav-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s;
}

.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.nav-menu {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(10, 15, 26, 0.98);
    backdrop-filter: blur(20px);
    padding: 16px;
    border-bottom: 1px solid var(--border);
    animation: slideDown 0.3s ease;
    z-index: 999;
}

.nav-menu.active { display: block; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
    background: var(--bg-surface);
    color: var(--primary-light);
}

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

.nav-user-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-user-name {
    font-size: 13px;
    color: var(--text-secondary);
}

.nav-logout-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-family: var(--font);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-logout-btn:hover {
    background: var(--accent-light);
    transform: scale(1.05);
}

/* ---- Disclaimer Banner ---- */
.disclaimer-banner {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    z-index: 998;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: var(--text-on-primary);
    text-align: center;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.disclaimer-icon { font-size: 14px; }

/* ---- Verification Notice ---- */
.verification-notice {
    position: relative;
    z-index: 1;
    margin: calc(var(--nav-height) + 40px + 16px) 16px 0;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

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

.verification-text strong {
    display: block;
    color: var(--warning);
    margin-bottom: 4px;
}

.verification-text p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ---- Main Content ---- */
.main-content {
    position: relative;
    z-index: 1;
    padding-top: calc(var(--nav-height) + 40px + 8px);
    padding-bottom: calc(var(--bottom-nav-height) + 20px);
    min-height: 100vh;
}

.auth-page .main-content {
    padding-top: 0;
    padding-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 8px 12px;
}

/* ---- Page Header ---- */
.page-header {
    text-align: center;
    padding: 16px 0;
}

.page-title {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ---- Auth Pages ---- */
.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 24px 16px;
    margin: 0 auto;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 28px 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

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

.auth-logo {
    font-size: 56px;
    margin-bottom: 12px;
    animation: bounce 2s ease infinite;
}

.auth-title {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(200, 164, 21, 0.15);
    border: 1px solid rgba(200, 164, 21, 0.3);
    color: var(--primary-light);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    margin-top: 12px;
}

.militant-badge {
    background: rgba(230, 57, 70, 0.1);
    border-color: rgba(230, 57, 70, 0.25);
    color: var(--accent-light);
    margin-top: 8px;
    font-size: 10px;
}

.auth-form { margin-top: 20px; }

.auth-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.auth-footer p {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 10px;
}

.auth-morocco-banner {
    text-align: center;
    margin-top: 20px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(200, 164, 21, 0.2), rgba(200, 164, 21, 0.1));
    border-radius: var(--radius-lg);
    font-weight: 700;
    font-size: 16px;
    color: var(--primary-light);
    animation: pulse 3s ease-in-out infinite;
}

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

/* ---- Forms ---- */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-label small {
    color: var(--text-muted);
    font-weight: 400;
}

.input-with-icon {
    position: relative;
}

.input-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    z-index: 1;
}

.form-input {
    width: 100%;
    padding: 12px 44px 12px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 15px;
    transition: all 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-hint {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Select dropdown */
.form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    cursor: pointer;
}

.form-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-select option {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 8px;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--text-on-primary);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    box-shadow: 0 6px 25px var(--primary-glow);
    transform: translateY(-1px);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: var(--bg-surface);
    border-color: var(--primary-light);
    color: var(--primary-light);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-predict {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-predict:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--primary-glow);
}

.btn-predict-submit {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    border-radius: var(--radius-md);
    margin-top: 16px;
}

/* ---- Alerts ---- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.5;
}

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

.alert-success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.alert-info {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

/* ---- Filter Tabs ---- */
.filter-tabs {
    display: flex;
    gap: 6px;
    padding: 4px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.filter-tab {
    flex: 1;
    text-align: center;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.filter-tab:hover { color: var(--text-primary); }

.filter-tab.active {
    background: var(--primary);
    color: var(--text-on-primary);
    box-shadow: var(--shadow-sm);
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

/* ---- Date Groups ---- */
.date-group {
    margin-bottom: 20px;
}

.date-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
}

.date-header.today {
    background: linear-gradient(135deg, rgba(200, 164, 21, 0.2), rgba(200, 164, 21, 0.05));
    border: 1px solid rgba(200, 164, 21, 0.3);
    color: var(--primary-light);
}

.today-badge {
    background: var(--primary);
    color: white;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
}

/* ---- Match Card ---- */
.match-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.match-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    transition: background 0.3s;
}

.match-card.upcoming::before { background: var(--info); }
.match-card.live::before { background: var(--accent); animation: livePulse 1.5s ease-in-out infinite; }
.match-card.finished::before { background: var(--text-muted); }
.match-card.has-prediction::before { background: var(--primary-light); }

.match-card:hover {
    border-color: var(--border-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Match Meta */
.match-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.match-group-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-surface);
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.match-time-badge {
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.match-time-badge.upcoming { color: var(--info); }
.match-time-badge.live { color: var(--accent); }
.match-time-badge.finished { color: var(--text-muted); }

.live-indicator {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: livePulse 1.5s ease-in-out infinite;
    display: inline-block;
}

/* Teams Row */
.match-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.team {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.team-flag {
    width: 56px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--border-light);
}

.team-flag-placeholder {
    width: 56px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: var(--bg-surface);
    border-radius: 6px;
    border: 2px solid var(--border-light);
}

.team-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Score Display */
.match-score-display {
    flex-shrink: 0;
}

.score-box {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-surface);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    min-width: 72px;
    justify-content: center;
}

.score-box.live {
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.2), rgba(230, 57, 70, 0.1));
    border: 1px solid rgba(230, 57, 70, 0.4);
    animation: scoreGlow 2s ease-in-out infinite;
}

@keyframes scoreGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(230, 57, 70, 0.2); }
    50% { box-shadow: 0 0 15px rgba(230, 57, 70, 0.4); }
}

.score-box.finished {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
}

.score-num {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    min-width: 16px;
    text-align: center;
}

.score-sep {
    font-size: 18px;
    color: var(--text-muted);
    font-weight: 700;
}

.score-dash {
    font-size: 18px;
    color: var(--text-muted);
    font-weight: 400;
}

/* Coefficients */
.match-coefficients {
    display: flex;
    gap: 6px;
    margin-top: 12px;
}

.coeff-item {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.coeff-item:hover {
    border-color: var(--primary-light);
    background: rgba(200, 164, 21, 0.1);
}

.coeff-label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.coeff-value {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--secondary);
}

/* Inline Prediction */
.my-prediction-inline {
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(200, 164, 21, 0.1);
    border: 1px solid rgba(200, 164, 21, 0.2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
}

.pred-label {
    color: var(--text-muted);
    font-weight: 500;
}

.pred-score {
    font-weight: 700;
    color: var(--primary-light);
    direction: ltr;
    display: inline-block;
}

.pred-result {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.pred-result.exact {
    background: rgba(200, 164, 21, 0.2);
    color: var(--secondary-light);
}

.pred-result.correct {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.pred-result.wrong {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

/* Match Action */
.match-action {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.lock-timer {
    font-size: 11px;
    color: var(--text-muted);
}

.locked-badge {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-surface);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
}

/* ---- Bottom Navigation ---- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 15, 26, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: flex;
    height: var(--bottom-nav-height);
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    position: relative;
}

.bottom-nav-item.active {
    color: var(--primary-light);
}

.bottom-nav-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--primary-light);
    border-radius: 0 0 4px 4px;
}

.bottom-nav-icon {
    font-size: 22px;
}

.bottom-nav-label {
    font-size: 10px;
}

/* ---- Leaderboard ---- */
.podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
    padding: 0 16px;
}

.podium-item {
    flex: 1;
    text-align: center;
    background: var(--bg-card);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 16px 8px;
    position: relative;
    border: 1px solid var(--border);
    border-bottom: none;
}

.podium-item.first {
    order: 0;
    padding-bottom: 24px;
}

.podium-item.second { order: -1; }
.podium-item.third { order: 1; }

.podium-rank { font-size: 32px; margin-bottom: 4px; }
.podium-item.first .podium-rank { font-size: 40px; }

.podium-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.podium-points {
    font-size: 14px;
    font-weight: 800;
    color: var(--secondary);
}

.podium-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 0;
}

.podium-item.first .podium-bar { height: 8px; background: linear-gradient(90deg, #ffd700, #ffaa00); }
.podium-item.second .podium-bar { height: 6px; background: linear-gradient(90deg, #c0c0c0, #a0a0a0); }
.podium-item.third .podium-bar { height: 4px; background: linear-gradient(90deg, #cd7f32, #a0621d); }

/* Leaderboard Tabs */
.lb-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 5px;
    border: 1px solid var(--border);
}

.lb-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    border-radius: var(--radius-md);
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.25s ease;
    text-decoration: none;
}

.lb-tab:hover {
    color: var(--text-primary);
    background: var(--bg-surface);
}

.lb-tab.active {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: var(--text-on-primary);
    box-shadow: var(--shadow-sm);
}

.lb-tab-icon { font-size: 22px; }
.lb-tab-label { font-size: 12px; }

/* Podium Enhancements */
.podium-crown {
    font-size: 20px;
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    animation: crownBounce 2s ease infinite;
}

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

.podium-medal { font-size: 28px; margin-bottom: 4px; }
.podium-item.first .podium-medal { font-size: 36px; }

.podium-avatar, .podium-avatar-geo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 4px auto;
    font-size: 16px;
    font-weight: 800;
    color: white;
}

.podium-avatar { background: linear-gradient(135deg, var(--primary), var(--primary-light)); }
.podium-avatar-geo { font-size: 24px; background: none; }

.podium-item.first .podium-avatar,
.podium-item.first .podium-avatar-geo { width: 48px; height: 48px; font-size: 18px; }
.podium-item.first .podium-avatar-geo { font-size: 28px; }

.podium-region {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.podium-points small {
    font-size: 10px;
    font-weight: 400;
    color: var(--text-muted);
}

/* Leaderboard List */
.lb-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.lb-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.lb-row:hover {
    border-color: var(--border-light);
    background: var(--bg-card-hover);
    transform: translateX(-2px);
}

.lb-row.lb-me {
    background: rgba(200, 164, 21, 0.08);
    border-color: rgba(200, 164, 21, 0.3);
}

.lb-row.lb-top {
    border-color: rgba(200, 164, 21, 0.2);
}

.lb-row.lb-hidden {
    display: none;
}

.lb-rank {
    width: 36px;
    text-align: center;
    flex-shrink: 0;
}

.lb-medal { font-size: 22px; }

.lb-rank-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-surface);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
}

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

.lb-info-wide { flex: 2; }

.lb-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lb-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lb-stats {
    text-align: center;
    flex-shrink: 0;
}

.lb-points {
    font-size: 20px;
    font-weight: 800;
    color: var(--secondary);
    line-height: 1;
}

.lb-detail {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    justify-content: center;
}

/* Progress Bar for geo rankings */
.lb-progress-bar {
    margin-top: 6px;
    height: 5px;
    background: var(--bg-surface);
    border-radius: 3px;
    overflow: hidden;
}

.lb-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
    transition: width 0.6s ease;
}

/* Show More Button */
.btn-show-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: var(--bg-card);
    border: 1px dashed var(--border-light);
    border-radius: var(--radius-md);
    color: var(--primary-light);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 12px;
}

.btn-show-more:hover {
    background: var(--bg-surface);
    border-color: var(--primary-light);
    transform: translateY(-1px);
}

.btn-show-more.expanded {
    border-style: solid;
}

.show-more-arrow {
    font-size: 12px;
    transition: transform 0.3s;
}

.btn-show-more.expanded .show-more-arrow {
    transform: rotate(180deg);
}

.me-badge {
    background: var(--primary);
    color: white;
    padding: 1px 8px;
    border-radius: var(--radius-full);
    font-size: 10px;
    margin-right: 4px;
}

.leaderboard-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ---- Stats Grid ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 8px;
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
}

.stat-points .stat-value { color: var(--secondary); }
.stat-total .stat-value { color: var(--info); }
.stat-correct .stat-value { color: var(--success); }
.stat-exact .stat-value { color: var(--secondary-light); }

/* ---- Prediction Cards ---- */
.predictions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.prediction-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    transition: all 0.2s;
}

.prediction-card.exact {
    border-color: rgba(200, 164, 21, 0.4);
    background: linear-gradient(135deg, var(--bg-card), rgba(200, 164, 21, 0.05));
}

.prediction-card.correct {
    border-color: rgba(34, 197, 94, 0.3);
}

.prediction-card.wrong {
    border-color: rgba(239, 68, 68, 0.2);
}

.pred-card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 11px;
    color: var(--text-muted);
}

.pred-card-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.pred-team {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.pred-team-flag {
    width: 40px;
    height: 28px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-light);
}

.pred-scores-block {
    flex-shrink: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pred-my-score, .pred-actual-score {
    font-size: 12px;
}

.pred-my-score small, .pred-actual-score small {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
}

.pred-my-score span {
    font-weight: 700;
    color: var(--primary-light);
    direction: ltr;
    display: inline-block;
}

.pred-actual-score span {
    font-weight: 700;
    color: var(--text-primary);
    direction: ltr;
    display: inline-block;
}

.pred-card-result {
    margin-top: 10px;
    text-align: center;
}

.result-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.result-badge.exact {
    background: rgba(200, 164, 21, 0.15);
    color: var(--secondary-light);
    border: 1px solid rgba(200, 164, 21, 0.3);
}

.result-badge.correct {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.result-badge.wrong {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.result-badge.pending {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ---- Profile ---- */
.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px 20px;
    text-align: center;
}

.profile-avatar {
    font-size: 64px;
    margin-bottom: 12px;
}

.profile-card h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.profile-phone {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 8px;
}

.profile-location {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.profile-status {
    display: inline-block;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
}

.profile-status.verified {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.profile-status.pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.profile-joined {
    font-size: 12px;
    color: var(--text-muted);
}

/* ---- Modal ---- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

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

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlide 0.3s ease;
}

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

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

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    padding: 0 8px;
    transition: color 0.2s;
}

.modal-close:hover { color: var(--text-primary); }

.modal-body {
    padding: 20px;
}

/* Score Input */
.score-input-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.score-input-team {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.pred-flag {
    width: 60px;
    height: 42px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid var(--border-light);
}

.score-input-team span {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.score-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.score-btn {
    width: 36px;
    height: 40px;
    background: var(--bg-surface-light);
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.score-btn:hover { background: var(--primary); color: white; }
.score-btn:active { transform: scale(0.95); }

.score-input {
    width: 44px;
    height: 40px;
    text-align: center;
    background: var(--bg-dark);
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 800;
    font-family: var(--font);
    outline: none;
    -moz-appearance: textfield;
}

.score-input::-webkit-inner-spin-button,
.score-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.score-vs {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-muted);
    padding: 0 4px;
}

/* ---- Toast ---- */
.toast {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 16px);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-surface);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 3000;
    transition: transform 0.3s ease;
    border: 1px solid var(--border-light);
    text-align: center;
    max-width: 90%;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.4);
    color: var(--success);
}

.toast.error {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: var(--error);
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

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

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

.admin-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    overflow: hidden;
}

.admin-card-header {
    padding: 14px 16px;
    background: var(--bg-surface);
    font-weight: 700;
    font-size: 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-card-body {
    padding: 16px;
}

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

.admin-table th, .admin-table td {
    padding: 10px 12px;
    text-align: right;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.admin-table th {
    background: var(--bg-surface);
    font-weight: 600;
    color: var(--text-muted);
}

.admin-table tr:hover {
    background: var(--bg-card-hover);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-success {
    background: var(--success);
    color: white;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.2s;
}

.btn-success:hover { opacity: 0.9; }

.btn-danger {
    background: var(--error);
    color: white;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.2s;
}

.btn-danger:hover { opacity: 0.9; }

.btn-info {
    background: var(--info);
    color: white;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.2s;
}

.btn-info:hover { opacity: 0.9; }

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.admin-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.admin-stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--secondary);
}

.admin-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.admin-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 16px;
}

.admin-back:hover { color: var(--primary-light); }

.coeff-input {
    width: 60px;
    padding: 6px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 14px;
    text-align: center;
}

.coeff-input:focus {
    border-color: var(--primary-light);
    outline: none;
}

/* ---- Responsive ---- */
@media (min-width: 640px) {
    .team-flag { width: 68px; height: 48px; }
    .team-name { font-size: 14px; max-width: 120px; }
    .score-num { font-size: 24px; }
    .match-card { padding: 18px; }
    .coeff-value { font-size: 15px; }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---- Accessibility ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---- PWA Install Banner ---- */
.pwa-install-banner {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 8px);
    left: 12px;
    right: 12px;
    z-index: 9999;
    animation: slideUpBanner 0.4s ease;
}

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

.pwa-install-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #1a2332, #111827);
    border: 1px solid var(--primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(200, 164, 21, 0.2), var(--shadow-md);
}

.pwa-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.pwa-text {
    flex: 1;
    min-width: 0;
}

.pwa-text strong {
    display: block;
    color: var(--text-primary);
    font-size: 13px;
    margin-bottom: 2px;
}

.pwa-text small {
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.3;
}

.pwa-install-btn {
    flex-shrink: 0;
    padding: 8px 18px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--text-on-primary);
    border: none;
    border-radius: var(--radius-full);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.pwa-install-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(200, 164, 21, 0.3);
}

.pwa-dismiss-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--border-light);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.pwa-dismiss-btn:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}
