/* ==========================================================
   HAMAM BÖCEĞİ MEME - DİNAMİK PNG SPRITE TASARIM SİSTEMİ
   ========================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
}

body {
    background-color: #0f172a;
    font-family: 'Outfit', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    color: #f8fafc;
}

/* Cihaz Çerçevesi / Ana Ekran (Arkaplan resmi tüm ekranı kaplar) */
.device-frame {
    width: 100%;
    height: 100%;
    background: url('bg.png');
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Oyun Konteyneri (9:16 Oranı Asla Bozulmaz ve Esnemez!) */
.game-container {
    width: 100%;
    height: 100%;
    max-width: min(100vw, calc(100vh * (9 / 16)));
    max-height: min(100vh, calc(100vw * (16 / 9)));
    aspect-ratio: 9 / 16;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

/* Üst Reklam Barı (1080x360 Orantılı - Ekranın %18.75'i) */
.top-ad-bar {
    width: 100%;
    aspect-ratio: 1080 / 360;
    max-height: 18.75%;
    background: rgba(0, 0, 0, 0.85);
    border-bottom: 2px solid #fbbf24;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 100;
    flex-shrink: 0;
    overflow: hidden;
}

.ad-placeholder {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 5px;
    z-index: 1;
    pointer-events: none;
}

.ad-label {
    font-size: 14px;
    font-weight: 800;
    color: #fbbf24;
    letter-spacing: 1px;
    animation: pulse 2s infinite;
    margin-bottom: 4px;
}

.ad-sublabel {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 600;
}

.adsbygoogle {
    position: relative;
    z-index: 2;
}

/* Sahne Alanı */
.stage-area {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* ==========================================================
   HAMAM BÖCEĞİ DİNAMİK PNG SPRITE OYNATICI
   ========================================================== */
.cockroach-wrapper {
    position: relative;
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.roach-sprite {
    max-width: 85%;
    max-height: 75%;
    object-fit: contain;
    filter: drop-shadow(0 15px 25px rgba(0,0,0,0.6));
    transition: transform 0.05s;
}

/* Sersemleme Yıldızları */
.dizzy-stars {
    position: absolute;
    top: 18%;
    font-size: 32px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 25;
}
.show-dizzy {
    opacity: 1;
    animation: spinStars 1.5s linear infinite;
}
@keyframes spinStars {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.3); }
    100% { transform: rotate(360deg) scale(1); }
}

/* ==========================================================
   AÇILIŞ YÜKLENME EKRANI (SPLASH SCREEN)
   ========================================================== */
.splash-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('bg.png') center/cover no-repeat;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.splash-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.85) 100%);
    z-index: 1;
}

.splash-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 90%;
}

.splash-roach {
    width: 220px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 20px 30px rgba(0,0,0,0.8));
    animation: floatSplash 2.5s ease-in-out infinite;
    margin-bottom: 20px;
}

@keyframes floatSplash {
    0%, 100% { transform: translateY(0) scale(1) rotate(0deg); }
    50% { transform: translateY(-15px) scale(1.05) rotate(3deg); }
}

.splash-title {
    font-family: 'Bangers', cursive;
    font-size: 52px;
    line-height: 1.1;
    color: #fbbf24;
    text-shadow: 4px 4px 0 #b91c1c, -2px -2px 0 #000, 0 8px 15px rgba(0,0,0,0.8);
    letter-spacing: 2px;
    margin-bottom: 30px;
}

.splash-title span {
    color: #ef4444;
    font-size: 64px;
    display: inline-block;
    animation: pulseTitle 1s infinite alternate;
}

@keyframes pulseTitle {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

.loading-bar-container {
    width: 80%;
    max-width: 280px;
    height: 18px;
    background: rgba(255, 255, 255, 0.15);
    border: 3px solid #fbbf24;
    border-radius: 20px;
    overflow: hidden;
    padding: 2px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    margin-bottom: 12px;
}

.loading-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    border-radius: 15px;
    transition: width 0.2s ease;
}

.loading-text {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

/* ==========================================================
   DARBE / SALDIRI SİLAHLARI (TRANSPARAN KOL VE BACAKLAR)
   ========================================================== */
.weapon-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 30;
    overflow: hidden;
}

.weapon-sprite {
    position: absolute;
    display: none;
    max-width: 500px;
    max-height: 500px;
    object-fit: contain;
    filter: drop-shadow(0 15px 20px rgba(0,0,0,0.7));
}

/* Silahların Başlangıç Konumları (Hepsi %20 Büyütüldü, Yumruk/Tokat %10 Aşağı, Tekme %20 Sağa Alındı) */
.fist-weapon { right: -400px; top: 20%; width: 354px; }
.slap-weapon { left: -400px; top: 15%; width: 354px; }
.kick-weapon { bottom: -500px; left: -5%; width: 432px; }
.stick-weapon { top: -400px; left: 20%; width: 354px; }

/* Darbe Animasyon Sınıfları */
.anim-fist { display: block !important; animation: attackFist 0.35s forwards cubic-bezier(0.1, 0.9, 0.2, 1); }
.anim-slap { display: block !important; animation: attackSlap 0.35s forwards cubic-bezier(0.1, 0.9, 0.2, 1); }
.anim-kick { display: block !important; animation: attackKick 0.4s forwards cubic-bezier(0.1, 0.9, 0.2, 1); }
.anim-stick { display: block !important; animation: attackStick 0.4s forwards cubic-bezier(0.1, 0.9, 0.2, 1); }

@keyframes attackFist {
    0% { right: -400px; top: 20%; transform: scale(0.75) rotate(0deg); }
    40% { right: 10%; top: 20%; transform: scale(1.10) rotate(-10deg); }
    100% { right: -400px; top: 20%; transform: scale(0.80) rotate(0deg); }
}
@keyframes attackSlap {
    0% { left: -400px; top: 15%; transform: scale(0.75) rotate(0deg); }
    40% { left: 10%; top: 15%; transform: scale(1.10) rotate(15deg); }
    100% { left: -400px; top: 15%; transform: scale(0.80) rotate(0deg); }
}
@keyframes attackKick {
    0% { bottom: -500px; left: -15%; transform: scale(0.80) rotate(-20deg); }
    40% { bottom: 12%; left: -5%; transform: scale(1.25) rotate(-15deg); }
    100% { bottom: -500px; left: -15%; transform: scale(0.85) rotate(-20deg); }
}
@keyframes attackStick {
    0% { top: -400px; transform: scale(0.75) rotate(30deg); }
    40% { top: 15%; transform: scale(1.20) rotate(-30deg); }
    100% { top: -400px; transform: scale(0.80) rotate(30deg); }
}

/* Komik Darbe Metin Efektleri */
.effects-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 40;
}
.comic-text {
    position: absolute;
    font-family: 'Bangers', cursive;
    font-size: 55px;
    color: #ef4444;
    text-shadow: 3px 3px 0 #fff, -2px -2px 0 #000;
    pointer-events: none;
    animation: floatUpFade 0.6s forwards cubic-bezier(0.1, 0.9, 0.2, 1);
}
@keyframes floatUpFade {
    0% { transform: scale(0.3) rotate(-15deg); opacity: 0; }
    50% { transform: scale(1.3) rotate(10deg); opacity: 1; }
    100% { transform: scale(1) translateY(-60px) rotate(0deg); opacity: 0; }
}

/* Ekran Sarsıntısı */
.shake-screen {
    animation: screenShake 0.3s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
@keyframes screenShake {
    0%, 100% { transform: translate(0, 0); }
    20%, 60% { transform: translate(-10px, 8px); }
    40%, 80% { transform: translate(10px, -8px); }
}

/* ==========================================================
   ALT SALDIRI BUTONLARI BARI
   ========================================================== */
.bottom-attack-bar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 15px 10px 25px 10px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(15px);
    border-top: 2px solid rgba(255, 255, 255, 0.15);
    z-index: 90;
}

.attack-btn {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    padding: 12px 3px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 0 #0f172a, 0 10px 15px rgba(0,0,0,0.5);
    transition: all 0.1s ease;
    position: relative;
    overflow: hidden;
}

.attack-btn:hover {
    transform: translateY(-2px);
    border-color: #38bdf8;
}

.attack-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #0f172a, 0 4px 6px rgba(0,0,0,0.5);
}

.btn-icon {
    font-size: 30px;
    margin-bottom: 4px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.btn-label {
    font-size: 10px;
    font-weight: 900;
    color: #fff;
    letter-spacing: 0.5px;
}

.btn-punch { background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%); }
.btn-slap { background: linear-gradient(135deg, #f97316 0%, #c2410c 100%); }
.btn-kick { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); }
.btn-stick { background: linear-gradient(135deg, #10b981 0%, #047857 100%); }
.btn-dance { background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%); }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
