/* Genel Ayarlar ve Fontlar */
@import url('https://fonts.googleapis.com/css2?family=Lilita+One&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #1a237e; /* Koyu mavi ana arka plan */
    color: #ffffff;
    font-family: 'Arial', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header ve Footer */
.page-header {
    padding: 10px 20px;
    background-color: #0d123b;
    text-align: left;
}

.homepage-logo {
    height: 40px;
    cursor: pointer;
}

.page-footer {
    background-color: #0d123b;
    padding: 15px;
    text-align: center;
    margin-top: auto;
}

.page-footer a {
    color: #fff;
    text-decoration: none;
    margin: 0 15px;
    font-weight: bold;
    font-size: 1.1em;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background-color 0.3s;
}

.page-footer a:hover,
.page-footer a.active {
    background-color: #3f51b5; /* Vurgu rengi */
}

/* Ana İçerik Alanı (İkiye Bölünmüş) */
.main-container {
    display: flex;
    flex: 1;
    padding: 20px;
    gap: 20px;
}

/* YENİ HALİ - Bu blokla değiştirin */
/* YENİ HALİ - Bu blokla değiştirin */
.content-panel {
    background-color: rgba(13, 18, 59, 0.7);
    border: 2px solid #3f51b5;
    border-radius: 15px;
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Bu hala önemli, kalsın */

    /* EKLENEN SATIR: İçerik taşmasını tamamen engeller */
    overflow: hidden; 
}
#games-panel {
    background-image: url('arka.png'); /* RESİM YOLUNU DEĞİŞTİRMEYİ UNUTMAYIN */
    background-size: cover; /* Resmi paneli kaplayacak şekilde boyutlandırır */
    background-position: center; /* Resmi ortalar */
    background-repeat: no-repeat; /* Resmin tekrarlanmasını engeller */
}

.content-panel h2 {
    font-family: 'Lilita One', cursive; /* Brawl Stars benzeri font */
    text-align: center;
    color: #ffc107; /* Sarı başlık rengi */
    margin-bottom: 20px;
    font-size: 2em;
    text-shadow: 2px 2px 4px #000;
}

/* YENİ VE NİHAİ HALİ - Bu blokla değiştirin */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    flex: 1;

    /* --- EN ÖNEMLİ KISIM BURASI --- */
    
    /* 1. Dikeyde gerektiğinde kaydırma çubuğu göster */
    overflow-y: auto;
    
    /* 2. Yatayda ASLA kaydırma çubuğu gösterme, taşan kısmı gizle */
    overflow-x: hidden;
    
    /* 3. Hover efektinin sığması için sağda küçük bir boşluk bırak.
       Bu, dikey kaydırma çubuğunun da içeriğe yapışmasını engeller. */
    padding-right: 10px; 
}

/* Ünite ve Oyun Kartları */
/* YENİ HALİ - Bu blokla değiştirin */
.unit-item, .game-card {
    background-color: #3f51b5;
    border-radius: 8px;
    border: 1px solid #8c9eff;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    /* EKLENEN SATIR: Elemanları kare yapar */
    aspect-ratio: 1 / 1;
}

.unit-item:hover, .game-card:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px #ffc107;
}

.unit-item.selected {
    border-color: #ffc107; /* Seçili ünite vurgusu */
    box-shadow: 0 0 15px #ffc107;
}

.unit-item img, .game-card img {
    width: 80%;
    max-width: 80px;
    margin-bottom: 8px;
}

.unit-item span, .game-card span {
    font-weight: bold;
    font-size: 0.9em;
}

/* YENİ HALİ - Kopyalayıp Değiştirin */
.placeholder {
    /* Dikey ve yatay ortalama için */
    display: flex;
    align-items: center; /* Dikeyde ortala */
    justify-content: center; /* Yatayda ortala */
    
    /* Grid container'ın tamamını kaplaması için */
    width: 100%;
    height: 100%;
    grid-column: 1 / -1; /* Bu satır önemli! Öğenin grid'in tüm sütunlarını kaplamasını sağlar. */

    /* Yazı stili istekleri */
    font-size: 1.5em; /* Yazıyı büyüttük (daha da büyük isterseniz 1.8em vb. deneyebilirsiniz) */
    color: #ffffff; /* Yazıyı tam beyaz yaptık */
    font-weight: bold; /* Daha belirgin olması için kalınlaştıralım */
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5); /* Yazıya hafif bir gölge ekleyerek okunabilirliği artırır */
}

/* Oyun Modal Penceresi (Iframe) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none; /* Başlangıçta gizli */
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.show {
    display: flex; /* Göstermek için */
}

.modal-content {
    position: relative;
    width: 90%;
    height: 90%;
    background: #0d123b;
    border: 3px solid #ffc107;
    border-radius: 15px;
    padding: 10px;
}

.close-button {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    background: #ffc107;
    color: #0d123b;
    border: 2px solid #fff;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

#game-iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 10px;
}

/* Mobil Cihazlar için Ayarlar */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    .page-footer a {
        margin: 5px;
        font-size: 0.9em;
    }
}