/* 1. Genel Sayfa Düzeni */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

/* Tüm sayfada çift tıklama yakınlaştırmasını kapatır */
html, body {
    touch-action: manipulation;
}

/* Özellikle butonlar ve karakter alanında tıklamaların daha hızlı 
   algılanmasını sağlar (300ms gecikmeyi de kaldırır) */
button, .character, .category-control {
    touch-action: manipulation;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #ffe9f9 0%, #ffffff 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.intro {
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    color: #ff1493;
    margin-bottom: 5px;
}

/* 2. Karakter Kabı */
.game-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    width: 100%;
    max-width: 1200px;
}

.character {
    position: relative;
    width: 400px;  /* Alan genişliği */
    height: 600px; /* Alan yüksekliği */
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    border: 5px solid white;
    flex-shrink: 0; /* Mobilde boyutun bozulmasını engeller */
}

/* 3. Katmanların Genel Ayarı */
.layer {
    position: absolute;
    transform-origin: top center;
    pointer-events: none;
}

/* --- ÖZEL PARÇA AYARLARI (PC İÇİN YAPTIĞIN AYARLAR) --- */

#body {
    z-index: 1;
    width: 100%;
    top: 0;
    left: 0;
}

#hair {
    z-index: 6;
    width: 30%;
    top: -2%;
    left: 40%;
}

#top {
    z-index: 4;
    width: 65%;
    bottom: 33%;
    left: 17%;
}

#bottom {
    z-index: 2;
    width: 60%;
    top: 53%;
    left: 17%;
}

#dress {
    z-index: 3;
    width: 65%;
    top: 20%;
    left: 17%;
}

#shoes {
    z-index: 5;
    width: 100%;
    top: 0;
    left: 0;
}

#accessories {
    z-index: 7;
    width: 75%;
    top: 200%; /* Bu değer çok yüksek, aksesuar görünmüyorsa kontrol etmelisin */
    left: 25%;
}

/* 4. Butonlar ve Kontrol Paneli */
.controls-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 400px;
}

.controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.category-control {
    background: white;
    padding: 10px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.category-control h3 {
    font-size: 0.8rem;
    margin-bottom: 8px;
    color: #d1127e;
}

button {
    background: #ff69b4;
    color: white;
    border: none;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
}

button:hover {
    background: #ff1493;
}

.save-btn {
    background: #9b30ff;
    padding: 12px;
    width: 100%;
    border-radius: 10px;
    margin-top: 10px;
    color: white;
    font-weight: bold;
    border: none;
    cursor: pointer;
}

/* --- 5. MOBİL UYUMLULUK AYARLARI --- */

@media (max-width: 850px) {
    .game-container {
        flex-direction: column; /* Mobilde alt alta diz */
        align-items: center;
        gap: 20px;
    }

    .character {
        /* Karakterin oranını bozmadan mobilde küçültüyoruz */
        width: 300px; 
        height: 450px;
        /* İçindeki resimlerin (layer) senin verdiğin % ve top/left değerlerine 
           göre doğru ölçeklenmesi için 'zoom' veya 'scale' yerine sabit küçültme kullandık */
    }

    .controls-wrapper {
        max-width: 350px; /* Buton panelini mobilde biraz daralt */
    }

    h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .character {
        width: 280px; /* Küçük telefonlar için biraz daha küçült */
        height: 420px;
    }
    
    .controls {
        grid-template-columns: 1fr 1fr; /* Mobilde de 2 sütun devam etsin */
    }
}