:root {
    --primary: #ff6a00;
    --primary-dim: rgba(255, 106, 0, 0.2);
    --secondary-glow: #cc2900;
    --bg-dark: #050505;
    --bg-card: rgba(255, 255, 255, 0.03);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { 
    background-color: var(--bg-dark); 
    overflow-x: hidden; 
    width: 100%;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Open Sans', sans-serif;
    overflow-x: hidden;
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 100vh; 
    min-height: 100dvh; 
}

main { flex: 1; }

.navbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 40px; background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(15px); border-bottom: 1px solid var(--border-color);
    position: sticky; top: 0; z-index: 1000;
}

.nav-brand { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    font-family: 'Montserrat', sans-serif; 
    font-size: 1.8rem; 
    font-weight: 900; 
    color: var(--text-main); 
    letter-spacing: 2px; 
}
.brand-logo { height: 40px; width: auto; object-fit: contain; }

.nav-links { display: flex; gap: 20px; }
.nav-btn {
    background: none; border: none; color: var(--text-muted);
    font-family: 'Open Sans', sans-serif; font-size: 1.1rem;
    font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
    cursor: pointer; transition: all 0.3s ease; padding: 8px 16px; border-radius: 4px;
}
.nav-btn:hover, .nav-btn.active { color: var(--primary); background: var(--primary-dim); }

.menu-toggle { display: none; flex-direction: column; cursor: pointer; gap: 6px; z-index: 1001; }
.menu-toggle .bar { width: 25px; height: 3px; background-color: var(--text-main); transition: all 0.3s ease-in-out; border-radius: 3px; }

.view { display: none; animation: fadeIn 0.4s ease-out forwards; }
.view.active { display: block; }
.page-content { max-width: 1400px; margin: 0 auto; padding: 40px 20px; width: 100%; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.page-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 30px; border-bottom: 1px solid var(--border-color); padding-bottom: 20px; flex-wrap: wrap; gap: 20px; }
.section-title { font-family: 'Montserrat', sans-serif; font-size: 2.5rem; letter-spacing: 2px; }

.filter-group { 
    display: flex; 
    gap: 10px; 
    overflow-x: auto; 
    padding-bottom: 5px; 
    width: 100%;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.filter-group::-webkit-scrollbar { display: none; }

.filter-btn { 
    background: var(--bg-card); 
    border: 1px solid var(--border-color); 
    color: var(--text-main); 
    padding: 8px 20px; 
    border-radius: 50px; 
    cursor: pointer; 
    font-family: 'Open Sans', sans-serif; 
    font-weight: 600; 
    transition: all 0.2s ease; 
    white-space: nowrap; 
    flex-shrink: 0; 
}
.filter-btn.active, .filter-btn:hover { border-color: var(--primary); box-shadow: 0 0 10px var(--primary-dim); }

.cyber-select {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 35px 8px 20px;
    border-radius: 50px;
    font-family: 'Open Sans', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23ff6a00%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.4-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 15px top 50%;
    background-size: 10px auto;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}
.cyber-select:focus, .cyber-select:hover { border-color: var(--primary); box-shadow: 0 0 10px var(--primary-dim); }
.cyber-select option { background: #0f0f0f; color: #fff; padding: 10px; }

.search-container { position: relative; width: 100%; max-width: 400px; }
.search-container::before { content: "⌕"; position: absolute; left: 20px; top: 50%; transform: translateY(-55%); font-size: 1.8rem; color: var(--primary); pointer-events: none; text-shadow: 0 0 10px var(--primary-dim); font-weight: bold; z-index: 2; }
#player-search, #stats-search, #teams-search { background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(255, 106, 0, 0.3); color: var(--text-main); padding: 14px 20px 14px 50px; border-radius: 50px; width: 100%; font-family: 'Open Sans', sans-serif; font-size: 1.1rem; letter-spacing: 1px; outline: none; box-shadow: inset 0 2px 15px rgba(0,0,0,0.8); transition: all 0.3s ease; backdrop-filter: blur(5px); }
#player-search:focus, #stats-search:focus, #teams-search:focus { border-color: var(--primary); box-shadow: inset 0 2px 15px rgba(0,0,0,0.8), 0 0 20px var(--primary-dim); background: rgba(0, 0, 0, 0.6); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 25px; }
.card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; padding: 20px; transition: all 0.3s ease; cursor: pointer; }
.card:hover { border-color: rgba(255, 106, 0, 0.5); transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.img-container { width: 100%; height: 180px; border-radius: 8px; overflow: hidden; margin-bottom: 15px; background: #111; }
.img-container img { width: 100%; height: 100%; object-fit: contain; }

.status-badge { 
    display: inline-block; padding: 4px 12px; border-radius: 4px; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; background: var(--primary-dim); color: var(--primary); border: 1px solid var(--primary); 
    position: relative; overflow: hidden;
}
.status-badge::after { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent); animation: shine 2.5s infinite; }
@keyframes shine { to { left: 100%; } }

.loader { text-align: center; font-family: monospace; color: var(--primary); grid-column: 1 / -1; padding: 40px; animation: pulse 1.5s infinite; }

/* Sticky Home Header Update */
.home-compact-header {
    position: sticky;
    top: 71px; /* Account for navbar */
    width: 100%;
    padding: 25px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: rgba(5, 5, 5, 0.85);
    backdrop-filter: blur(15px);
    z-index: 900;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: padding 0.3s ease;
}

/* Extracted Ambient Light so it stays perfectly behind everything */
.ambient-light { 
    position: fixed; 
    top: 50%; left: 50%; width: 100vw; height: 100vh; 
    transform: translate(-50%, -50%); 
    background: radial-gradient(circle, rgba(204, 41, 0, 0.15) 0%, rgba(255, 106, 0, 0.05) 40%, rgba(5, 5, 5, 0) 70%); 
    z-index: 0; 
    animation: pulseGlow 8s infinite alternate; 
    pointer-events: none; 
}
@keyframes pulseGlow { 0% { opacity: 0.5; transform: translate(-50%, -50%) scale(0.9); } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } }

.scene { position: relative; z-index: 10; transform-style: preserve-3d; animation: float3D 6s ease-in-out infinite; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 15px; }

.hero-main-logo { max-width: 400px; width: 80%; transform: translateZ(50px); margin-bottom: 20px; animation: logoPulse 4s ease-in-out infinite; }
@keyframes logoPulse { 0%, 100% { filter: drop-shadow(0 0 20px rgba(255, 106, 0, 0.3)); transform: translateZ(50px) scale(1); } 50% { filter: drop-shadow(0 0 40px rgba(255, 106, 0, 0.6)); transform: translateZ(50px) scale(1.02); } }
.cyber-particles { position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.particle { position: absolute; color: var(--primary); opacity: 0.1; font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 1.5rem; animation: floatParticle 10s infinite linear; }
.particle.p1 { top: 15%; left: 15%; animation-duration: 12s; font-size: 2rem; }
.particle.p2 { top: 75%; left: 10%; animation-duration: 15s; font-size: 1.2rem; }
.particle.p3 { top: 25%; right: 20%; animation-duration: 10s; }
.particle.p4 { top: 80%; right: 15%; animation-duration: 18s; font-size: 1.8rem; }
.particle.p5 { top: 45%; left: 5%; animation-duration: 14s; }
.particle.p6 { top: 60%; right: 5%; animation-duration: 11s; }
.particle.p7 { top: 10%; right: 40%; animation-duration: 16s; }
.particle.p8 { top: 85%; left: 45%; animation-duration: 13s; }
@keyframes floatParticle { 0% { transform: translateY(20px) rotate(0deg); opacity: 0.02; } 50% { opacity: 0.15; } 100% { transform: translateY(-50px) rotate(180deg); opacity: 0.02; } }

.home-cinematic-container .subtitle { font-size: 1.8rem; font-weight: 700; color: var(--primary); letter-spacing: 3px; text-transform: none; transform: translateZ(40px); text-shadow: 0 0 10px rgba(255, 106, 0, 0.4); pointer-events: none; }
.large-badge { margin-top: 15px; padding: 12px 35px; font-size: 1.2rem; letter-spacing: 3px; border-radius: 50px; backdrop-filter: blur(10px); transform: translateZ(30px); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3); }

.site-footer { background: #020202; border-top: 1px solid var(--border-color); padding: 40px 20px 30px; padding-bottom: calc(30px + env(safe-area-inset-bottom)); margin-top: auto; }
.footer-container { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; margin-bottom: 30px; }
.footer-brand p { 
    color: var(--primary); 
    font-size: 0.95rem; 
    letter-spacing: 2px; /* Adds nice spacing without forcing uppercase */
    font-weight: 600; 
}
.footer-links h4, .footer-socials h4 { color: var(--text-main); margin-bottom: 15px; font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px; }
.footer-links a, .footer-socials a { display: block; color: var(--text-muted); text-decoration: none; margin-bottom: 10px; transition: color 0.3s ease; font-weight: 500; }
.footer-links a:hover, .footer-socials a:hover { color: var(--primary); }
.footer-bottom { text-align: center; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.05); color: var(--text-muted); font-size: 0.9rem; letter-spacing: 1px; }

@keyframes float3D { 0% { transform: rotateX(5deg) rotateY(-10deg) translateY(0px); } 50% { transform: rotateX(-5deg) rotateY(10deg) translateY(-20px); } 100% { transform: rotateX(5deg) rotateY(-10deg) translateY(0px); } }

.back-btn { margin-bottom: 20px; color: var(--primary); padding: 0; font-size: 1.2rem; text-align: left; display: inline-block; border-radius: 0; }
.back-btn:hover { background: none; text-shadow: 0 0 10px var(--primary-dim); }

.tournament-hero { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; padding: 30px; margin-bottom: 30px; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.tournament-hero img { max-width: 300px; max-height: 200px; object-fit: contain; border-radius: 8px; border: 1px solid var(--primary-dim); background: #111; }
.hero-info h2 { font-family: 'Montserrat', sans-serif; font-size: 2.5rem; color: var(--text-main); margin-bottom: 10px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }

.phase-container { display: grid; gap: 20px; }
.format-phase { background: rgba(255, 255, 255, 0.02); border-left: 4px solid var(--primary); padding: 25px; border-radius: 0 8px 8px 0; }
.phase-title { font-family: 'Open Sans', sans-serif; font-weight: 700; color: var(--primary); font-size: 1.6rem; margin-bottom: 15px; text-transform: uppercase; letter-spacing: 1px; }

.card div { font-family: 'Open Sans', sans-serif; letter-spacing: 0.2px; }
.card h3 { font-family: 'Open Sans', sans-serif; }

.format-phase p, .format-phase ul li, .hero-info div { font-family: 'Open Sans', sans-serif; letter-spacing: 0.3px; line-height: 1.6; color: rgba(255, 255, 255, 0.9); }
.format-phase ul { list-style-type: none; margin-top: 15px; }
.format-phase ul li { background: rgba(0, 0, 0, 0.4); margin-bottom: 8px; padding: 10px 15px; border-radius: 4px; border: 1px solid rgba(255, 106, 0, 0.2); font-size: 1rem; color: var(--text-muted); }
.format-phase strong, .format-phase b { font-weight: 600; color: #ffffff; }

.groups-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 40px; }
.group-card { background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; }
.group-header { background: var(--primary); color: #050505; font-family: 'Montserrat', sans-serif; font-weight: 900; text-align: center; padding: 12px; font-size: 1.3rem; letter-spacing: 1.5px; }

.team-list { list-style: none; padding: 0; margin: 0; }
.team-list li { display: flex; align-items: center; justify-content: flex-start; gap: 12px; padding: 10px 15px; border-bottom: 1px solid rgba(255,255,255,0.05); font-family: 'Open Sans', sans-serif; font-size: 1rem; color: rgba(255,255,255,0.8); transition: all 0.3s ease; }
.team-list li:last-child { border-bottom: none; }
.team-list li:nth-child(even) { background: rgba(255,255,255,0.02); }
.team-list li:hover { color: var(--primary); background: rgba(255, 106, 0, 0.1); font-weight: 600; padding-left: 20px; }
.group-team-logo { width: 24px; height: 24px; object-fit: contain; border-radius: 4px; }

.team-logo-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; }
.team-box { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 8px; padding: 10px 5px; text-align: center; cursor: pointer; transition: all 0.3s ease; min-width: 0; }
.team-box:hover { border-color: var(--primary); transform: translateY(-5px); box-shadow: 0 5px 20px rgba(255, 106, 0, 0.2); }
.team-box img { width: 60px; height: 60px; object-fit: contain; margin-bottom: 8px; border-radius: 4px; }
.team-box-name { font-family: 'Montserrat', sans-serif; font-size: 0.75rem; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 5px; }

@media (max-width: 992px) { .team-logo-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

.profile-meta { font-family: 'Open Sans', sans-serif; color: rgba(255,255,255,0.9); font-size: 1.1rem; margin-bottom: 10px; line-height: 1.5; }
.profile-meta span { color: var(--primary); font-weight: 600; }
.roster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; margin-top: 20px; }
.player-card { background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 15px; text-align: center; cursor: pointer; transition: 0.3s; }
.player-card:hover { border-color: var(--primary); background: rgba(255,106,0,0.05); }
.player-card img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin-bottom: 10px; border: 2px solid var(--primary-dim); }
.player-name { font-family: 'Open Sans', sans-serif; font-size: 1.4rem; font-weight: 700; color: #fff; }

/* PLAYER PROFILE CARD & MOBILE FIX */
.player-profile-card {
    background:var(--bg-card); 
    border:1px solid var(--border-color); 
    border-radius:12px; 
    padding:30px 40px; 
    display:flex; 
    align-items:center; 
    gap:25px; 
    margin-bottom: 30px;
}
.player-profile-info h2 { 
    font-size:3rem; 
    font-family:'Montserrat', sans-serif; 
    text-transform: uppercase; 
    color: var(--primary); 
    margin:0; 
    line-height: 1; 
}
.player-meta { 
    font-size: 1.1rem; 
    color: rgba(255,255,255,0.8); 
    margin-top: 8px; 
    font-family: 'Open Sans', sans-serif; 
}
.meta-label { color: var(--text-muted); }
.meta-value { color: #fff; text-transform: uppercase; }
.team-link { cursor:pointer; transition: color 0.2s; }
.team-link:hover { color: var(--primary); }
.meta-divider { margin: 0 10px; color: var(--text-muted); }

.table-container { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; padding: 20px; margin-top: 20px; }
.table-responsive { width: 100%; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--primary) #111; }
.cyber-table { width: 100%; border-collapse: collapse; font-family: 'Open Sans', sans-serif; min-width: 800px; }

.cyber-table th { 
    background: rgba(255, 106, 0, 0.1); color: var(--primary); 
    font-family: 'Montserrat', sans-serif; font-size: 0.9rem; letter-spacing: 1px; 
    text-align: center; padding: 15px; border-bottom: 2px solid var(--primary); white-space: nowrap; 
}
.cyber-table td { 
    padding: 12px 15px; border-bottom: 1px solid rgba(255,255,255,0.05); 
    color: rgba(255,255,255,0.85); font-size: 1rem; white-space: nowrap; 
    text-align: center; 
}

.cyber-table th:nth-child(2), .cyber-table td:nth-child(2) { text-align: left; }
.cyber-table tbody tr { transition: background 0.2s ease; }
.cyber-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.cyber-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.01); }

.cyber-table tbody tr.row-promote { background: rgba(0, 255, 0, 0.05) !important; }
.cyber-table tbody tr.row-promote td:first-child { border-left: 3px solid #00ff00; }
.cyber-table tbody tr.row-promote td { color: #00ff00; font-weight: 600; text-shadow: 0 0 5px rgba(0, 255, 0, 0.2); }

.cyber-table tbody tr.row-relegate { background: rgba(255, 0, 0, 0.05) !important; }
.cyber-table tbody tr.row-relegate td:first-child { border-left: 3px solid #ff0000; }

.table-logo { width: 30px; height: 30px; object-fit: contain; vertical-align: middle; margin-right: 10px; border-radius: 4px; }
.rank-col { font-family: 'Montserrat', sans-serif; font-weight: 700; color: #fff; }
.highlight-col { color: var(--primary) !important; font-weight: 700; }

.sub-nav-btn { background: none; border: 1px solid transparent; color: var(--text-muted); padding: 5px 15px; border-radius: 4px; cursor: pointer; font-family: 'Open Sans'; font-weight: 600; font-size: 1rem; transition: 0.2s; }
.sub-nav-btn:hover, .sub-nav-btn.active { color: #fff; border-bottom: 2px solid var(--primary); }

.schedule-wrapper { max-width: 550px; margin: 20px 0 30px 0; background: var(--bg-card); border-radius: 8px; border: 1px solid var(--border-color); }
.schedule-table { min-width: 500px !important; border-collapse: collapse; }
.schedule-table th { background: rgba(0,0,0,0.4); text-align: center; font-family: 'Montserrat', sans-serif; color: #fff; padding: 12px; font-size: 1rem; border-bottom: 1px solid var(--border-color); }
.schedule-table td { text-align: center; padding: 10px; border-bottom: 1px solid rgba(255,255,255,0.05); color: rgba(255,255,255,0.8); font-weight: 600; }
.schedule-table tbody tr:nth-child(even) { background: rgba(255,255,255,0.02); }

/* --- NEW SEEDING TABLE BADGES & STYLES --- */
.seed-badge { padding: 4px 10px; border-radius: 4px; font-size: 0.8rem; font-weight: bold; text-transform: uppercase; white-space: nowrap; }
.seed-finals { background: rgba(0, 255, 0, 0.15); color: #00ff00; border: 1px solid #00ff00; }
.seed-semis { background: rgba(255, 204, 0, 0.15); color: #ffcc00; border: 1px solid #ffcc00; }
.seed-survival { background: rgba(0, 150, 255, 0.15); color: #0096ff; border: 1px solid #0096ff; }
.seed-eliminated { background: rgba(255, 0, 0, 0.15); color: #ff0000; border: 1px solid #ff0000; }
.seed-pending { background: rgba(255, 255, 255, 0.1); color: var(--text-muted); border: 1px solid var(--text-muted); }

.compact-schedule-toggle summary::-webkit-details-marker { display: none; }

.stats-overview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 40px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; padding: 30px 20px; text-align: center; border-bottom: 3px solid var(--primary); transition: all 0.3s ease; }
.stat-card:hover { transform: translateY(-5px); border-color: var(--primary); }
.stat-card h3 { font-family: 'Montserrat', sans-serif; font-size: 3rem; color: var(--primary); margin-bottom: 5px; text-shadow: 0 0 15px rgba(255, 106, 0, 0.3); }
.stat-card p { font-size: 1.1rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }

/* FIX: FORCED 2x2 LAYOUT ON DESKTOP */
.home-featured-section { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 25px; 
}

.featured-box { 
    background: rgba(255,255,255,0.02); 
    border: 1px solid var(--border-color); 
    border-radius: 12px; 
    padding: 30px; 
    transition: all 0.3s ease; 
}
.featured-box:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 106, 0, 0.15);
}
.featured-box h3 { font-family: 'Montserrat', sans-serif; font-size: 1.5rem; margin-bottom: 15px; color: #fff; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 10px; }
.featured-box p { font-size: 1.1rem; line-height: 1.6; color: rgba(255,255,255,0.8); margin-bottom: 25px; }

.quick-rank-list { list-style: none; margin-bottom: 25px; }
.quick-rank-list li { display: flex; align-items: center; gap: 15px; padding: 12px 0; border-bottom: 1px dashed rgba(255,255,255,0.05); }
.quick-rank-list li:last-child { border-bottom: none; }
.quick-rank-rank { font-family: 'Montserrat', sans-serif; color: var(--primary); font-weight: bold; font-size: 1.2rem; width: 30px; }

.telemetry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 10px;
}
.telemetry-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(0, 0, 0, 0.8) 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
}
.telemetry-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(255, 106, 0, 0.1);
}
.telemetry-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: var(--primary);
    box-shadow: 0 0 15px var(--primary);
    opacity: 0.5;
}
.telemetry-title {
    font-family: 'Open Sans', sans-serif;
    font-size: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
}
.telemetry-value {
    font-family: 'Montserrat', sans-serif;
    font-size: 3.5rem;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}
.telemetry-sub {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.4);
    margin-top: 10px;
}

.trending-orgs-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.trending-org-btn {
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
    border-radius: 4px;
    font-size: 0.95rem;
}
.trending-org-btn:hover {
    background: var(--primary-dim);
    color: #fff;
}

.text-content-page {
    max-width: 900px;
}
.text-content-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 40px;
    font-family: 'Open Sans', sans-serif;
    line-height: 1.8;
    color: rgba(255,255,255,0.85);
    font-size: 1.05rem;
}

.master-search-wrapper { margin-top: 20px; max-width: 600px; width: 100%; position: relative; z-index: 50; }
.master-search-wrapper input {
    width: 100%; padding: 15px 25px 15px 50px; border-radius: 50px; 
    background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(255, 106, 0, 0.3); 
    color: #fff; font-family: 'Open Sans', sans-serif; font-size: 1.1rem; 
    outline: none; backdrop-filter: blur(10px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); 
    transition: border-color 0.3s ease, border-radius 0.2s ease;
}
.search-icon { position: absolute; left: 20px; top: 22px; transform: translateY(-50%); font-size: 1.5rem; color: var(--primary); pointer-events: none; }


/* TABLET & MOBILE MEDIA QUERIES */
@media (max-width: 992px) {
    /* FIX: SWITCH TO 1 COLUMN ON MOBILE/TABLET */
    .home-featured-section { grid-template-columns: 1fr; }
    
    .team-logo-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
    .navbar { padding: 15px 20px; flex-direction: row; justify-content: space-between; }
    .menu-toggle { display: flex; }
    
    .nav-links { 
        position: absolute; top: 100%; left: 0; width: 100%; 
        background: rgba(10, 10, 10, 0.98); backdrop-filter: blur(20px); 
        flex-direction: column; justify-content: flex-start; transition: all 0.3s ease-in-out; 
        z-index: 1000; gap: 0; opacity: 0; pointer-events: none; transform: translateY(-10px);
        border-bottom: 1px solid var(--border-color); padding: 0;
    }
    .nav-links.active { opacity: 1; pointer-events: auto; transform: translateY(0); box-shadow: 0 10px 30px rgba(0,0,0,0.8); }
    .nav-btn { font-size: 1.2rem; width: 100%; padding: 20px 0; border-radius: 0; background: transparent; border-bottom: 1px solid rgba(255,255,255,0.05); text-align: center; }
    .nav-btn.active { background: linear-gradient(90deg, rgba(255, 106, 0, 0.1), transparent); color: var(--primary); border-left: 4px solid var(--primary); border-bottom: 1px solid rgba(255, 106, 0, 0.1); }

    .menu-toggle.is-active .bar:nth-child(1) { transform: translateY(9px) rotate(45deg); background-color: var(--primary); }
    .menu-toggle.is-active .bar:nth-child(2) { opacity: 0; }
    .menu-toggle.is-active .bar:nth-child(3) { transform: translateY(-9px) rotate(-45deg); background-color: var(--primary); }
    
    .hero-main-logo { max-width: 250px; }
    .particle { font-size: 1rem; opacity: 0.05; }
    .particle.p5, .particle.p6, .particle.p7, .particle.p8 { display: none; }
    
    .home-cinematic-container .subtitle { font-size: 1.2rem; }
    .large-badge { font-size: 0.9rem; padding: 10px 20px; }
    .search-container { max-width: 100%; margin-top: 15px; }
    .footer-container { text-align: center; }
    .team-logo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

    .table-container { padding: 15px 10px; }
    .cyber-table { min-width: max-content; }
    .cyber-table th { padding: 12px 12px; font-size: 0.8rem; letter-spacing: 0px; text-align: center; }
    .cyber-table td { padding: 12px 12px; font-size: 0.9rem; text-align: center; }
    .cyber-table th:nth-child(2), .cyber-table td:nth-child(2) { text-align: left; }
    
    .table-logo { width: 22px; height: 22px; margin-right: 8px; }
    .rank-col { font-size: 0.9rem; }

    /* Player Profile Mobile Layout Overrides */
    .player-profile-card { flex-direction: column; text-align: center; padding: 25px 20px; gap: 15px; }
    .player-profile-info h2 { font-size: 2.2rem; }
    .player-meta { display: flex; flex-direction: column; gap: 5px; font-size: 0.95rem; }
    .meta-divider { display: none; }
    
    /* Sticky Header Mobile Adjustment */
    .home-compact-header { top: 60px; padding: 20px 15px 15px; }
}

@media (max-width: 480px) { 
    .team-logo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } 
    .team-box { padding: 8px 2px; } 
    .cyber-table th { padding: 10px 10px; font-size: 0.75rem; }
    .cyber-table td { padding: 10px 10px; font-size: 0.85rem; }
    .table-logo { width: 20px; height: 20px; margin-right: 6px; }
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid var(--primary);
    border-radius: 12px;
    padding-top: 10px;
    padding-bottom: 10px;
    max-height: 350px;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.9);
    z-index: 100;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) #111;
}
.search-dropdown::-webkit-scrollbar { width: 6px; }
.search-dropdown::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 10px; }

.search-result-item {
    padding: 12px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer !important;
    user-select: none;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: all 0.2s ease;
    text-align: left;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: rgba(255, 106, 0, 0.15); padding-left: 30px; }

.search-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 1px;
    font-family: 'Montserrat', sans-serif;
    display: inline-block;
}
.badge-team { background: rgba(0, 255, 0, 0.1); color: #00ff00; border: 1px solid #00ff00; }
.badge-player { background: rgba(255, 106, 0, 0.1); color: var(--primary); border: 1px solid var(--primary); }
.badge-event { background: rgba(0, 150, 255, 0.1); color: #0096ff; border: 1px solid #0096ff; }

/* COMPLETE TOOLTIP CSS */
.custom-tooltip {
    position: relative;
    display: inline-block;
    cursor: pointer !important;
    font-size: 0.85em;
    opacity: 0.8;
    padding: 0 5px;
    outline: none;
    user-select: none; 
    -webkit-user-select: none; 
}

.custom-tooltip .tooltip-text {
    visibility: hidden;
    width: 220px;
    background-color: var(--bg-dark);
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 10px;
    position: absolute;
    z-index: 1000;
    top: 150%; 
    right: 0; 
    opacity: 0;
    transition: opacity 0.3s;
    border: 1px solid var(--primary);
    box-shadow: 0 10px 20px rgba(0,0,0,0.8);
    font-size: 0.8rem;
    font-family: 'Open Sans', sans-serif;
    text-transform: none;
    font-weight: 400;
    line-height: 1.4;
    white-space: normal;
    pointer-events: none;
}

.custom-tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    bottom: 100%; 
    right: 15px; 
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent var(--primary) transparent; 
}

/* THE MISSING PIECE: This actually makes it appear */
.custom-tooltip:hover .tooltip-text,
.custom-tooltip:focus .tooltip-text,
.custom-tooltip:active .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* --- DYNAMIC CSS INJECTION ENHANCEMENTS --- */
.team-box { position: relative; overflow: hidden; display: flex; justify-content: center; align-items: center; min-height: 120px;}
.team-box-front { transition: all 0.4s ease; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; }
.team-box-back { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    background: linear-gradient(135deg, rgba(15, 15, 15, 0.98) 0%, rgba(5, 5, 5, 1) 100%); 
    border: 1px solid var(--primary); 
    box-shadow: inset 0 0 15px rgba(255, 106, 0, 0.2);
    border-radius: 8px; 
    display: flex; flex-direction: column; align-items: center; justify-content: center; 
    opacity: 0; transform: translateY(100%); transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    padding: 5px; z-index: 10;
}
.team-box:hover .team-box-front { opacity: 0; transform: translateY(-20px); }
.team-box:hover .team-box-back { opacity: 1; transform: translateY(0); }
.roster-name { font-family: 'Open Sans', sans-serif; font-size: 0.75rem; font-weight: 700; color: #fff; margin: 1px 0; letter-spacing: 0.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 95%; text-align: center;}
.roster-title { font-family: 'Montserrat', sans-serif; font-size: 0.65rem; color: var(--primary); margin-bottom: 3px; border-bottom: 1px solid rgba(255,106,0,0.3); padding-bottom: 2px; text-transform: uppercase; letter-spacing: 1px;}

/* CUSTOM 2-LETTER FALLBACK LOGO STYLES */
.fallback-logo {
    display: inline-flex; align-items: center; justify-content: center;
    background: #111; border: 1px solid var(--primary-dim); color: var(--primary);
    font-family: 'Montserrat', sans-serif; font-weight: 900;
    border-radius: 8px; text-transform: uppercase; box-sizing: border-box; overflow: hidden;
    flex-shrink: 0;
}

/* UNIVERSAL LOGO SIZING */
img { color: transparent; }
img.table-logo, .fallback-logo.table-logo { width: 30px; height: 30px; font-size: 0.85rem; margin-right: 10px; vertical-align: middle; border-radius: 4px; object-fit: contain; flex-shrink: 0; }
img.group-team-logo, .fallback-logo.group-team-logo { width: 30px; height: 30px; font-size: 0.85rem; border-radius: 4px; object-fit: contain; flex-shrink: 0; }
img.spotlight-logo, .fallback-logo.spotlight-logo { width: 24px; height: 24px; font-size: 0.7rem; margin-right: 8px; border-radius: 4px; object-fit: contain; flex-shrink: 0; }
img.quick-rank-logo, .fallback-logo.quick-rank-logo { width: 30px; height: 30px; font-size: 0.85rem; border-radius: 4px; object-fit: contain; flex-shrink: 0; }
img.directory-logo, .fallback-logo.directory-logo { width: 60px; height: 60px; font-size: 1.5rem; margin-bottom: 8px; border-radius: 4px; object-fit: contain; flex-shrink: 0; }
img.hero-logo, .fallback-logo.hero-logo { width: 120px; height: 120px; font-size: 3rem; object-fit: contain; border-radius: 8px; }

/* --- MAP-WISE TOGGLE & HIDDEN COLUMNS CSS --- */
.map-col { display: none; }
.show-map-stats .map-col { 
    display: table-cell; 
    color: var(--primary); 
    font-weight: 600; 
    background: rgba(255, 106, 0, 0.05); 
}
.map-wise-toggle-container { 
    display: none; 
    margin-left: auto; 
    align-items: center; 
    background: rgba(0,0,0,0.4); 
    padding: 8px 15px; 
    border-radius: 50px; 
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}
.map-wise-toggle-container:hover { border-color: var(--primary); box-shadow: 0 0 10px var(--primary-dim); }
.map-wise-toggle-container.active { display: flex; }

/* --- RESPONSIVE TEAM NAMES --- */
.team-name-short { display: none; }

/* --- MOBILE STICKY COLUMNS & RESPONSIVE TEXT FOR TABLES --- */
@media (max-width: 992px) {
    .team-name-full { display: none; }
    .team-name-short { display: inline; font-weight: bold; }

    .cyber-table th:nth-child(1), .cyber-table td:nth-child(1) {
        position: sticky; left: 0; z-index: 2; background-color: #050505; 
    }
    .cyber-table th:nth-child(2), .cyber-table td:nth-child(2) {
        position: sticky; left: 45px; z-index: 2; background-color: #050505; border-right: 1px solid var(--border-color); 
    }
    .cyber-table thead th:nth-child(1), .cyber-table thead th:nth-child(2) { z-index: 3; background-color: #1a0f0a; }
    .cyber-table tbody tr:nth-child(even) td:nth-child(1), .cyber-table tbody tr:nth-child(even) td:nth-child(2) { background-color: #0a0a0a; }
    .cyber-table tbody tr:hover td:nth-child(1), .cyber-table tbody tr:hover td:nth-child(2) { background-color: #111111; }
    .cyber-table tbody tr.row-promote td:nth-child(1), .cyber-table tbody tr.row-promote td:nth-child(2) { background-color: #051405 !important; }
    .cyber-table tbody tr.row-relegate td:nth-child(1), .cyber-table tbody tr.row-relegate td:nth-child(2) { background-color: #140505 !important; }
}
