@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&family=Teko:wght@500;600;700&display=swap');

:root {
    --bg-dark: #050505;
    --bg-card: rgba(20, 20, 20, 0.85); /* Mobilde okunurluk için biraz daha koyu */
    --neon-primary: #00ff9d;
    --neon-secondary: #00b8ff;
    --neon-accent: #ff0055;
    --text-main: #ffffff;
    --text-muted: #888888;
    --border-glass: rgba(255, 255, 255, 0.1);
    --font-head: 'Teko', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --dock-height: 70px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    overflow-x: hidden; /* Sayfanın sağa sola kaymasını engeller */
    padding-bottom: calc(var(--dock-height) + 40px); /* Alt menü için güvenli boşluk */
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(0, 255, 157, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(0, 184, 255, 0.08) 0%, transparent 50%);
    background-attachment: fixed;
}

/* 1. TICKER FIX */
.news-ticker {
    background: #000;
    border-bottom: 1px solid var(--neon-primary);
    overflow: hidden; white-space: nowrap; height: 30px;
    display: flex; align-items: center;
    position: relative; z-index: 101;
}
.ticker-content {
    display: inline-block;
    padding-left: 100%;
    animation: ticker 25s linear infinite;
    font-family: var(--font-head);
    font-size: 0.9rem; color: var(--neon-primary); letter-spacing: 1px;
}
@keyframes ticker { 0% { transform: translate3d(0, 0, 0); } 100% { transform: translate3d(-100%, 0, 0); } }

/* HEADER FIX */
header {
    padding: 15px 20px; display: flex; justify-content: space-between; align-items: center;
    position: sticky; top: 0; z-index: 90; /* Tablo sütunundan yüksek olmalı */
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    background: rgba(5, 5, 5, 0.9);
    border-bottom: 1px solid var(--border-glass);
}
.brand { font-family: var(--font-head); font-size: 1.8rem; font-weight: 600; line-height: 1; }
.brand span { color: var(--neon-primary); }
.user-pill {
    background: rgba(255,255,255,0.08); padding: 4px 10px; border-radius: 30px;
    font-size: 0.75rem; border: 1px solid var(--border-glass); display: flex; align-items: center; gap: 6px;
}
.dot { width: 6px; height: 6px; background: var(--neon-primary); border-radius: 50%; box-shadow: 0 0 6px var(--neon-primary); }

/* CONTENT & SECTIONS */
.content { display: none; padding: 15px; animation: fadeIn 0.4s ease; }
.content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.section-head { margin-bottom: 15px; display: flex; justify-content: space-between; align-items: end; border-left: 3px solid var(--neon-primary); padding-left: 10px; }
.section-head h2 { font-family: var(--font-head); font-size: 1.8rem; text-transform: uppercase; line-height: 0.9; margin: 0; }
.section-head span { font-size: 0.75rem; color: var(--text-muted); }

/* LEAGUE BUTTONS (Scroll Fix) */
.league-tabs { 
    display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 10px; 
    -webkit-overflow-scrolling: touch; /* iOS smooth scroll */
    scrollbar-width: none; 
}
.league-tabs::-webkit-scrollbar { display: none; }

.l-btn {
    background: var(--bg-card); border: 1px solid var(--border-glass); color: var(--text-muted);
    padding: 8px 16px; border-radius: 8px; font-family: var(--font-head); font-size: 1.1rem;
    cursor: pointer; transition: 0.2s; white-space: nowrap; flex-shrink: 0;
}
.l-btn.active { background: var(--neon-primary); color: #000; font-weight: 700; border-color: var(--neon-primary); }

/* --- TABLE FIXES (EN ÖNEMLİ KISIM) --- */
.table-wrapper {
    background: #0f0f0f; /* Şeffaflığı kapattık ki yazılar birbirine girmesin */
    border-radius: 12px; border: 1px solid var(--border-glass);
    overflow: hidden; position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}
.table-scroll { 
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch; 
    width: 100%;
}
.standings-table { 
    width: 100%; 
    border-collapse: separate; /* Sticky için gerekli */
    border-spacing: 0; 
    min-width: 650px; /* Tabloyu genişletir, mobilde kaydırmayı zorunlu kılar */
}

/* Başlıklar */
.standings-table th {
    background: #1a1a1a; color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase;
    padding: 12px 6px; text-align: center; white-space: nowrap; font-weight: 600;
    border-bottom: 1px solid var(--border-glass);
    position: sticky; top: 0; z-index: 10;
}

/* Hücreler */
.standings-table td { 
    padding: 12px 6px; border-bottom: 1px solid var(--border-glass); 
    text-align: center; font-size: 0.85rem; color: #eee;
}

/* --- STICKY COLUMN FIX (Takım İsmi Sabitleme) --- */
/* 2. Sütun (Takım İsmi) hem başlıkta hem hücrede sabitlenmeli */
.standings-table th:nth-child(2),
.standings-table td:nth-child(2) {
    position: sticky; left: 0; z-index: 11; /* Diğer hücrelerden üstte */
    background: #141414; /* Arka plan rengi ŞART yoksa yazılar karışır */
    border-right: 1px solid var(--border-glass);
    text-align: left; min-width: 130px; max-width: 130px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Başlığın z-index'i daha yüksek olmalı */
.standings-table th:nth-child(2) { z-index: 12; background: #1a1a1a; }

.team-flex { display: flex; align-items: center; gap: 8px; }
.team-flex img { width: 20px; height: 20px; object-fit: contain; flex-shrink: 0;}
.team-flex span { overflow: hidden; text-overflow: ellipsis; }

/* Özel Sütun Renklendirmeleri */
.standings-table td:nth-child(3) { color: var(--neon-primary); font-weight: 700; font-size: 1rem; background: rgba(0, 255, 157, 0.03); } /* Puan */
.standings-table td:nth-child(4) { font-weight: 700; border-right: 1px solid var(--border-glass); } /* Maç */

.my-team-row td { background: rgba(0, 255, 157, 0.15) !important; }
.my-team-row td:nth-child(2) { background: #0b1f15 !important; border-left: 3px solid var(--neon-primary); }

/* PROFILE CARD FIX */
.profile-card {
    background: linear-gradient(180deg, #181818 0%, #050505 100%);
    border: 1px solid var(--border-glass); border-radius: 16px; padding: 20px;
    position: relative; overflow: hidden;
}
.profile-card::before {
    content:''; position: absolute; top:0; left:0; width:100%; height:3px;
    background: linear-gradient(90deg, var(--neon-primary), var(--neon-secondary));
}
.profile-header { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; }
.p-logo-box {
    width: 70px; height: 70px; background: #000; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-glass); box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    flex-shrink: 0;
}
.p-logo-box img { width: 50px; height: 50px; object-fit: contain; }
.p-info h2 { font-family: var(--font-head); font-size: 1.8rem; line-height: 1; margin: 0 0 5px 0; color: #fff; }
.p-badge { background: #222; padding: 2px 8px; border-radius: 4px; font-size: 0.7rem; color: var(--text-muted); border: 1px solid #333; margin-right: 5px; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 20px; }
.stat-item { background: rgba(255,255,255,0.03); padding: 10px 5px; border-radius: 8px; text-align: center; border: 1px solid var(--border-glass); }
.stat-item small { display: block; font-size: 0.6rem; color: var(--text-muted); letter-spacing: 0.5px; margin-bottom: 2px; }
.stat-item strong { font-size: 1.2rem; font-family: var(--font-head); color: var(--text-main); }
.highlight-stat { background: rgba(0, 255, 157, 0.05); border-color: rgba(0, 255, 157, 0.2); }
.highlight-stat strong { color: var(--neon-primary); font-size: 1.4rem; }

/* Form Visuals */
.form-tracker { margin-top: 15px; }
.form-title { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; }
.form-dots { display: flex; gap: 6px; }
.f-dot { width: 100%; height: 6px; border-radius: 2px; background: #333; }
.f-dot.win { background: var(--neon-primary); box-shadow: 0 0 5px var(--neon-primary); }
.f-dot.loss { background: var(--neon-accent); }
.f-dot.draw { background: #888; }

/* MARKET & SPONSORS */
.market-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.m-card {
    background: var(--bg-card); padding: 12px; border-radius: 12px;
    border: 1px solid var(--border-glass); display: flex; align-items: center; gap: 12px;
}
.m-icon { font-size: 1.4rem; color: var(--neon-secondary); width: 40px; text-align: center;}
.m-info h3 { font-family: var(--font-head); font-size: 1.2rem; margin: 0;}
.m-info p { font-size: 0.75rem; color: var(--text-muted); margin: 0; }
.btn-buy { margin-left: auto; background: #fff; color: #000; border: none; padding: 6px 12px; border-radius: 6px; font-weight: 700; font-family: var(--font-head); font-size: 1rem; cursor: pointer; }

.sponsor-img { width: 100%; border-radius: 10px; border: 1px solid var(--border-glass); margin-bottom: 10px; opacity: 0.9; }

/* BOTTOM DOCK (Mobile Navigation) */
.dock {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    background: rgba(10, 10, 10, 0.95); backdrop-filter: blur(15px);
    border: 1px solid var(--border-glass);
    padding: 8px 20px; border-radius: 40px;
    display: flex; gap: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    z-index: 100;
    width: auto; max-width: 90%;
    /* iPhone Safe Area */
    margin-bottom: env(safe-area-inset-bottom);
}
.dock-btn {
    background: none; border: none; color: #666; font-size: 1.3rem;
    transition: 0.2s; cursor: pointer; position: relative; padding: 5px;
}
.dock-btn.active { color: var(--neon-primary); transform: translateY(-3px); }
.dock-btn.active::after {
    content:''; position: absolute; bottom: -5px; left: 50%; transform: translateX(-50%);
    width: 4px; height: 4px; background: var(--neon-primary); border-radius: 50%; box-shadow: 0 0 5px var(--neon-primary);
}