/* ==========================================================================
   DEĞİŞKENLER VE TEMEL AYARLAR
   ========================================================================== */
:root {
    --gold: #ffcd3c;
    --gold-glow: rgba(255, 205, 60, 0.4);
    --bg-dark: #030308;
    --accent-blue: #00f2ff;
    --accent-blue-glow: rgba(0, 242, 255, 0.3);
    --font-main: 'Rajdhani', sans-serif;
    --font-heading: 'Orbitron', sans-serif;
    --transition-fast: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    background: url('background_images/home_bg.png') center/cover fixed no-repeat;
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;

}

.scanline {
    position: fixed;
    inset: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
    background-size: 100% 4px;
    z-index: 999;
    pointer-events: none;
    opacity: 0.4;
}

/* ==========================================================================
   VIEWPORT VE ARKA PLAN YAPISI
   ========================================================================== */
.app-viewport {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    isolation: isolate;
}

.app-viewport::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: 
        linear-gradient(rgba(0, 242, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 242, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(circle at 50% 50%, black 20%, transparent 85%);
    z-index: -1;
    pointer-events: none;
}

.scale-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    background: linear-gradient(135deg, rgba(5, 12, 24, 0.5) 0%, rgba(2, 4, 8, 0.75) 100%);
}

.main-container {
    flex: 1 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 120px 20px 120px 20px;
    position: relative;
    z-index: 2;
    width: 100%;
}

/* ==========================================================================
   ANA PANEL (Fraksiyon Grupları Bu Kutunun Çevresine Kilitli)
   ========================================================================== */
.main-section {
    text-align: center;
    padding: 60px 80px;
    background: rgba(2, 4, 12, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 242, 255, 0.15);
    border-radius: 24px;
    max-width: 780px;
    width: 100%;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
    z-index: 3;
}

/* ==========================================================================
   FRAKSİYON KAPSAYICILARI VE KATMAN AYARLARI (ZOOM KORUMASI)
   ========================================================================== */
/* ==========================================================================
   FRAKSİYON KAPSAYICILARI VE KATMAN AYARLARI (ZOOM KORUMASI)
   ========================================================================== */
.faction-group {
    position: absolute;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-layer {
    position: absolute;
    pointer-events: none;
}

/* Katman öncelikleri ve genel filtre efektleri */
.faction-planet {
    z-index: -2; /* Gezegen kesinlikle geminin arkasında kalır */
    width: 260px; /* Gezegenlerin temel boyutunu büyüttük ki arkadan taşsınlar */
    filter: drop-shadow(0 0 20px rgba(0, 242, 255, 0.15));
    opacity: 0.6; /* Gemiyi kapatmaması için arka plan tınısı verdik */
}

.faction-ship {
    z-index: -1; /* Gemi, gezegeninin bir katman önündedir */
}

/* --------------------------------------------------------------------------
   1. GRUP: VELYSSAR (Sağ Üst Konumlandırma ve Animasyon)
   -------------------------------------------------------------------------- */
.group-velyssar {
    top: -180px;    /* Çakışmayı önlemek için grubu biraz daha yukarı taşıdık */
    right: -340px;  /* Grubu biraz daha sağa aldık */
    width: 380px;
    height: 380px;
    animation: floatVelyssarGroup 9s ease-in-out infinite;
}
.group-velyssar .faction-ship {
    width: 380px;
    transform: rotate(-25deg);
    filter: drop-shadow(0 0 35px rgba(255, 205, 60, 0.25)) brightness(0.95);
}
.group-velyssar .faction-planet {
    /* Gezegeni %130 büyütüp, geminin sol üst çaprazına doğru geriye çektik */
    transform: translate(-90px, -60px) scale(1.3); 
    filter: drop-shadow(0 0 40px rgba(255, 205, 60, 0.25));
    opacity: 0.55;
}

/* --------------------------------------------------------------------------
   2. GRUP: SYNARI (Sol Alt Konumlandırma ve Animasyon)
   -------------------------------------------------------------------------- */
.group-synari {
    bottom: -140px; /* Grubu biraz daha aşağı çektik */
    left: -360px;   /* Grubu biraz daha sola çektik */
    width: 450px;
    height: 450px;
    animation: floatSynariGroup 10s ease-in-out infinite;
}
.group-synari .faction-ship {
    width: 450px;
    transform: rotate(-12deg);
    filter: drop-shadow(0 0 30px rgba(0, 242, 255, 0.2)) brightness(0.9);
}
.group-synari .faction-planet {
    /* Gezegeni iyice sola çektik (-10px -> -90px) */
    transform: translate(-90px, -50px) scale(1.2);
    opacity: 0.5;
}

/* --------------------------------------------------------------------------
   3. GRUP: SOLARI (Sağ Alt Konumlandırma ve Animasyon)
   -------------------------------------------------------------------------- */
.group-solari {
    bottom: -160px; /* Grubu biraz aşağı aldık */
    right: -380px;  /* Grubu biraz sağa aldık */
    width: 480px;
    height: 480px;
    animation: floatSolariGroup 11s ease-in-out infinite;
}
.group-solari .faction-ship {
    width: 480px;
    transform: rotate(12deg) scaleX(-1);
    filter: drop-shadow(0 0 30px rgba(0, 242, 255, 0.2)) brightness(0.9);
}
.group-solari .faction-planet {
    /* Gezegeni iyice sağa ittik (10px -> 100px) */
    transform: translate(100px, -70px) scale(1.25);
    opacity: 0.5;
}

/* GRUP SÜZÜLME ANİMASYONLARI (Gemi ve Gezegen Senkronize Süzülür) */
@keyframes floatVelyssarGroup {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(15px, 15px) scale(1.03); }
}
@keyframes floatSynariGroup {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-15px, -20px) scale(1.02); }
}
@keyframes floatSolariGroup {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(15px, -20px) scale(1.02); }
}

/* ==========================================================================
   HUD VE DİĞER DETAYLAR
   ========================================================================== */
.hud-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid var(--accent-blue);
    opacity: 0.6;
}
.hud-corner.top-left { top: 12px; left: 12px; border-right: none; border-bottom: none; }
.hud-corner.top-right { top: 12px; right: 12px; border-left: none; border-bottom: none; }
.hud-corner.bottom-left { bottom: 12px; left: 12px; border-right: none; border-top: none; }
.hud-corner.bottom-right { bottom: 12px; right: 12px; border-left: none; border-top: none; }

.logo-wrapper {
    position: relative;
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-logo {
    width: 100%;
    max-width: 260px;
    animation: floatLogo 5s ease-in-out infinite;
    z-index: 2;
}

.orbit-system {
    position: absolute;
    top: 50%;
    left: 70%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    pointer-events: none;
    z-index: 1;
}

.spark {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform-origin: -130px center;
    animation: orbit-rotate linear infinite;
}

.spark.red { background: #ff4d4d; box-shadow: 0 0 15px #ff4d4d; animation-duration: 5s; }
.spark.gold { background: var(--gold); box-shadow: 0 0 15px var(--gold); animation-duration: 8s; }
.spark.green { background: #07de27; box-shadow: 0 0 15px #07b70a; animation-duration: 11s; }

@keyframes orbit-rotate { to { transform: rotate(360deg); } }
@keyframes floatLogo { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

h1 {
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 6vw, 3.8rem);
    font-weight: 900;
    letter-spacing: 12px;
    background: linear-gradient(to bottom, #ffffff 40%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 45px;
    letter-spacing: 2px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* BUTTONS */
.cta-group { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; }

.btn {
    position: relative;
    padding: 16px 45px;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 3px;
    clip-path: polygon(12px 0%, 100% 0%, calc(100% - 12px) 100%, 0% 100%);
    transition: var(--transition-fast);
}

.btn-primary { background: var(--gold); color: #000; }
.btn-primary:hover { background: #fff; transform: translateY(-2px); box-shadow: 0 0 25px var(--gold-glow); }
.btn-secondary { background: rgba(0, 242, 255, 0.03); color: var(--accent-blue); border: 1px solid rgba(0, 242, 255, 0.4); }
.btn-secondary:hover { background: rgba(0, 242, 255, 0.12); color: #fff; border-color: var(--accent-blue); transform: translateY(-2px); box-shadow: 0 0 25px var(--accent-blue-glow); }

/* STATUS & FOOTER */
.status-bar {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    gap: 24px;
    background: rgba(2, 4, 10, 0.85);
    padding: 8px 18px;
    border-right: 3px solid var(--accent-blue);
    border-left: 3px solid var(--gold);
    font-size: 1.2rem;
    font-family: var(--font-heading);
    z-index: 100;
}
.status-bar .online { font-size: 1.2rem;color: #4dff88; font-weight: bold; }
.status-bar .sector {font-size: 1.2rem; color: var(--accent-blue); }
.status-bar .total-count { font-size: 1.2rem; color: #ffcd3c; font-weight: bold; }
.status-bar .online-count {font-size: 1.2rem; color: #4dff88; font-weight: bold; }

/* ==========================================================================
   LANGUAGE SWITCHER — Dairesel Bayrak Seçici (HUD Stili)
   ========================================================================== */
.lang-switcher {
    position: absolute;
    top: 70px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 10px;
    background: rgba(2, 4, 10, 0.55);
    border: 1px solid rgba(0, 242, 255, 0.12);
    border-radius: 999px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    z-index: 100;
}

.lang-icon {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
    filter: grayscale(55%) brightness(0.85);
    opacity: 0.75;
    transition: var(--transition-fast);
}

.lang-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.02); /* kenar boşluğu sızıntısını önler */
}

/* Hover: Odaklan ve büyü */
.lang-icon:hover {
    filter: grayscale(0%) brightness(1);
    opacity: 1;
    border-color: var(--accent-blue);
    transform: translateY(-3px) scale(1.12);
    box-shadow:
        0 0 0 2px rgba(0, 0, 0, 0.35),
        0 0 16px var(--accent-blue-glow);
}

/* Aktif dil: Altın çerçeve + hafif iç parlama, sabit büyük ve net */
.lang-icon.active {
    filter: grayscale(0%) brightness(1);
    opacity: 1;
    border-color: var(--gold);
    transform: scale(1.08);
    box-shadow:
        0 0 0 2px rgba(0, 0, 0, 0.35),
        0 0 14px var(--gold-glow),
        0 0 0 1px var(--gold) inset;
}

/* Aktif ikon altında küçük gösterge noktası */
.lang-icon.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 6px var(--gold);
}

/* Tooltip: Dil adını üstte gösterir */
.lang-icon::before {
    content: attr(data-label);
    position: absolute;
    top: -32px;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: rgba(2, 4, 10, 0.95);
    color: var(--accent-blue);
    font-family: var(--font-heading);
    font-size: 0.6rem;
    letter-spacing: 1.5px;
    padding: 4px 9px;
    border-radius: 4px;
    border: 1px solid rgba(0, 242, 255, 0.25);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-fast);
}

.lang-icon:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
    .lang-switcher {
        top: 64px;
        right: 12px;
        gap: 8px;
        padding: 5px 8px;
    }
    .lang-icon { width: 26px; height: 26px; }
    .lang-icon::before { display: none; } /* mobilde tooltip gerekmez */
}

/* ==========================================================================
   FOOTER — Sci-Fi HUD Alt Bar
   ========================================================================== */
footer {
    background: linear-gradient(180deg, rgba(2, 3, 7, 0.85) 0%, rgba(2, 3, 7, 0.98) 100%);
    padding: 16px 30px;
    border-top: 1px solid rgba(0, 242, 255, 0.15);
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 2000;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.5);
}

/* İnce üstteki neon çizgi vurgusu */
footer::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
    opacity: 0.6;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    gap: 20px;
}

/* Sol taraf: Copyright metni */
footer p {
    color: rgba(255, 255, 255, 0.35);
    font-size: 1rem;
    font-family: var(--font-main);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

/* Yanıp sönen küçük "sistem aktif" göstergesi */
footer p::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4dff88;
    box-shadow: 0 0 6px #4dff88, 0 0 10px #4dff88;
    animation: footerPulse 2.4s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes footerPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

/* Sağ taraf: Sosyal linkler */
.social-links {
    display: flex;
    gap: 10px;
}

.s-link {
    position: relative;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.02);
    clip-path: polygon(6px 0%, 100% 0%, calc(100% - 6px) 100%, 0% 100%);
    transition: var(--transition-fast);
}

.s-link:hover {
    background: var(--accent-blue);
    color: #000;
    border-color: var(--accent-blue);
    transform: translateY(-3px);
    box-shadow: 0 4px 16px var(--accent-blue-glow);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
    footer { padding: 14px 20px; }

    .footer-inner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    footer p {
        font-size: 0.65rem;
        letter-spacing: 1px;
    }

    .social-links { gap: 8px; }

    .s-link {
        font-size: 0.65rem;
        padding: 5px 11px;
    }
}

/* ==========================================================================
   RESPONSIVE & ZOOM STABILITY (KIRILMA NOKTALARI)
   ========================================================================== */
@media (max-width: 1400px) {
    /* Orta ekranlarda grupların boyutlarını orantılı küçültüyoruz */
    .group-synari { left: -240px; width: 360px; height: 360px; bottom: -80px; }
    .group-synari .faction-ship { width: 360px; }
    .group-synari .faction-planet { width: 150px; }

    .group-solari { right: -240px; width: 380px; height: 380px; bottom: -80px; }
    .group-solari .faction-ship { width: 380px; }
    .group-solari .faction-planet { width: 160px; }

    .group-velyssar { right: -220px; width: 300px; height: 300px; top: -100px; }
    .group-velyssar .faction-ship { width: 300px; }
    .group-velyssar .faction-planet { width: 140px; }
}

@media (max-width: 1100px) {
    /* Ekran daraldıkça yazıların arkasında kalıp göz yormaması için tüm grupların şeffaflığını kısıyoruz */
    .group-synari { left: -140px; bottom: -100px; opacity: 0.35; }
    .group-solari { right: -140px; bottom: -100px; opacity: 0.35; }
    .group-velyssar { right: -140px; top: -120px; opacity: 0.35; }
}

@media (max-width: 768px) {
    .main-container { padding-bottom: 140px; }
    .main-section { padding: 40px 24px; }
    
    /* Mobilde temiz bir UI için alt iki devasa grubu gizliyoruz */
    .group-synari, .group-solari { display: none; }
    
    /* Sadece sağ üstteki Velyssar grubunu mobil ekran boyutuna göre optimize edip şeffaf bırakıyoruz */
    .group-velyssar { width: 220px; height: 220px; top: -140px; right: -20px; opacity: 0.4; }
    .group-velyssar .faction-ship { width: 220px; }
    .group-velyssar .faction-planet { width: 100px; transform: translate(-10px, -10px); }

    .orbit-system { display: none; }
    .cta-group { flex-direction: column; width: 100%; }
    .footer-inner { flex-direction: column; gap: 12px; }
}

/* ==========================================================================
   HIGH-END SCI-FI GLITCH TEXT (PROFESYONEL ORBITRON BAŞLIK)
   ========================================================================== */
.glitch-text {
    font-family: var(--font-heading), 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 2.5rem; /* Önceki kodundaki h1 boyutunu korur */
    text-transform: uppercase;
    position: relative;
    letter-spacing: 12px; /* Geniş fütüristik harf arası */
    display: inline-block;
    
    /* Profesyonel degrade geçişi ve hafif neon parlama */
    background: linear-gradient(to bottom, #ffffff 40%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(255, 205, 60, 0.2), 0 0 40px rgba(0, 242, 255, 0.1);
    
    /* Donmaları ve performans kayıplarını önlemek için tarayıcı optimizasyonu */
    will-change: transform;
}

/* Glitch katmanlarının ortak ayarları */
.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #030308; /* Arka plan rengin ile eşleşerek keskin siber kesikler oluşturur */
    -webkit-background-clip: text;
    pointer-events: none;
}

/* Sol Siber-Mavi (Cyan) Parazit Katmanı */
.glitch-text::before {
    left: 3px;
    text-shadow: -3px 0 var(--accent-blue), 0 0 10px var(--accent-blue);
    clip-path: inset(80% 0 0 0); /* Eski 'clip' yerine modern ve performanslı 'clip-path' */
    animation: sciFiGlitchCyan 4s infinite steps(2, end);
    opacity: 0;
}

/* Sağ Siber-Altın (Gold) Parazit Katmanı */
.glitch-text::after {
    left: -3px;
    text-shadow: 3px 0 var(--gold), 0 0 10px var(--gold);
    clip-path: inset(0 0 80% 0);
    animation: sciFiGlitchGold 4s infinite steps(2, end);
    opacity: 0;
}

/* ==========================================================================
   PROFESYONEL PARAZİT ANİMASYONLARI (steps() ile anlık sıçramalar sağlar)
   ========================================================================== */

/* Mavi Katman Animasyonu: %0-85 arası temiz bekler, son %15'te anlık patlamalar yapar */
@keyframes sciFiGlitchCyan {
    0%, 85% { clip-path: inset(100% 0 0 0); opacity: 0; transform: scale(1); }
    86%     { clip-path: inset(12% 0 55% 0); opacity: 1; transform: skewX(-5deg); }
    88%     { clip-path: inset(70% 0 5% 0); opacity: 0.8; transform: skewX(2deg); }
    90%     { clip-path: inset(30% 0 40% 0); opacity: 1; transform: translate(-2px, 1px); }
    92%     { clip-path: inset(100% 0 0 0); opacity: 0; }
    94%     { clip-path: inset(55% 0 12% 0); opacity: 1; transform: skewX(10deg) scaleY(1.1); }
    96%     { clip-path: inset(5% 0 85% 0); opacity: 0.9; transform: translate(3px, -1px); }
    98%, 100% { clip-path: inset(100% 0 0 0); opacity: 0; transform: scale(1); }
}

/* Altın Katman Animasyonu: Farklı zamanlarda milisaniyelik yatay kaymalar yaratır */
@keyframes sciFiGlitchGold {
    0%, 82% { clip-path: inset(0 0 100% 0); opacity: 0; transform: scale(1); }
    83%     { clip-path: inset(40% 0 20% 0); opacity: 1; transform: skewX(5deg); }
    85%     { clip-path: inset(10% 0 75% 0); opacity: 0.7; transform: translate(2px, -2px); }
    87%     { clip-path: inset(0 0 100% 0); opacity: 0; }
    91%     { clip-path: inset(82% 0 5% 0); opacity: 1; transform: skewX(-8deg) scaleY(0.9); }
    93%     { clip-path: inset(25% 0 60% 0); opacity: 0.9; transform: translate(-3px, 2px); }
    95%, 100% { clip-path: inset(0 0 100% 0); opacity: 0; transform: scale(1); }
}

