.pointerlock-cursor-none,
.pointerlock-cursor-none * {
  cursor: none !important;
}

#crosshair {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 9px;
  height: 9px;
  /* Salon nötr koyu (siyah/gri): açık, nötr bir nişangâh her duvarda okunur.
     Etkileşimde JS'in çevirdiği renk de aynı nötr aileden (bkz. kontrol.js). */
  background: rgba(236, 238, 242, 0.45);
  border-radius: 50%;
  z-index: 999;
  pointer-events: none;
  transition: background-color 0.2s ease;
}

#joystick-container {
  position: fixed;
  left: 24px;
  bottom: 24px;
  width: 110px;
  height: 110px;
  z-index: 3600;
  display: none;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

body.joystick-enabled #joystick-container {
  display: flex;
}

body.joystick-disabled #joystick-container {
  display: none !important;
}

#joystick-bg {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  position: absolute;
  left: 0;
  top: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.075), rgba(10, 10, 12, 0.28));
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.2);
}

#joystick {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  position: absolute;
  left: 23px;
  top: 23px;
  background: radial-gradient(circle at 30% 30%, #f2f2f2, #d9d9d9);
  border: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.25),
    inset 0 2px 3px rgba(255, 255, 255, 0.3);
  transition: transform 0.1s ease;
  touch-action: none;
}

#joystick:active {
  transform: scale(0.95);
  background: radial-gradient(circle at 40% 40%, #e0e0e0, #bfbfbf);
  box-shadow:
    0 1px 4px rgba(0, 0, 0, 0.3),
    inset 0 2px 4px rgba(0, 0, 0, 0.25);
}

@media (max-width: 768px) {
  #joystick-container {
    display: flex;
    left: 16px;
    bottom: 16px;
    width: 86px;
    height: 86px;
  }

  #joystick-bg {
    width: 86px;
    height: 86px;
  }

  #joystick {
    width: 48px;
    height: 48px;
    left: 19px;
    top: 19px;
  }

  #crosshair {
    width: 7px;
    height: 7px;
    background: rgba(236, 238, 242, 0.4);
  }
}

@media (any-pointer: coarse), (pointer: coarse), (any-hover: none), (hover: none) {
  #joystick-container {
    display: flex;
  }
}

/* Mobile Firing Button */
#mobile-shoot-btn {
    position: fixed;
    right: 32px;
    bottom: 32px;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(230, 57, 70, 0.15) 0%, rgba(20, 20, 25, 0.8) 100%);
    border: 2px solid rgba(230, 57, 70, 0.55);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), inset 0 0 15px rgba(230, 57, 70, 0.2);
    z-index: 3600;
    display: none; /* Managed by JS */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    outline: none;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.1s ease, border-color 0.2s, box-shadow 0.2s;
}

#mobile-shoot-btn:active {
    transform: scale(0.9);
    border-color: #e63946;
    background: radial-gradient(circle, rgba(230, 57, 70, 0.45) 0%, rgba(20, 20, 25, 0.9) 100%);
    box-shadow: 0 4px 15px rgba(230, 57, 70, 0.4), 0 0 20px rgba(230, 57, 70, 0.7);
}

.shoot-btn-icon {
    width: 32px;
    height: 32px;
    border: 2.5px dashed rgba(255, 255, 255, 0.75);
    border-radius: 50%;
    position: relative;
}

.shoot-btn-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #e63946;
    border-radius: 50%;
    box-shadow: 0 0 8px #e63946;
}

@media (max-width: 768px) {
    #mobile-shoot-btn {
        right: 24px;
        bottom: 24px;
        width: 60px;
        height: 60px;
    }
    .shoot-btn-icon {
        width: 28px;
        height: 28px;
    }
}

/* Mobile Jump Button Styles */
#mobile-jump-btn {
    display: none;
}

body.touch-device #mobile-jump-btn {
    display: flex;
    position: fixed;
    right: 112px;
    bottom: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.06) 0%, rgba(20, 20, 25, 0.8) 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), inset 0 0 8px rgba(255, 255, 255, 0.05);
    z-index: 3600;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    outline: none;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.1s ease, border-color 0.2s, background-color 0.2s;
}

body.touch-device #mobile-jump-btn:active {
    transform: scale(0.9);
    border-color: rgba(255, 255, 255, 0.55);
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, rgba(20, 20, 25, 0.9) 100%);
}

@media (max-width: 768px) {
    body.touch-device #mobile-jump-btn {
        right: 104px;
        bottom: 24px;
        width: 52px;
        height: 52px;
    }
}

/* Mobil sniper dürbünü düğmesi — sağ-tık basılı-tutun dokunmatik karşılığı.
   JS yalnız sniper kuşanılmışken .mobile-visible ekler; zıplama düğmesinin solunda. */
#mobile-scope-btn { display: none; }
body.touch-device #mobile-scope-btn.mobile-visible {
    display: flex;
    position: fixed;
    right: 180px;
    bottom: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    z-index: 3600;
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    background: radial-gradient(circle, rgba(255, 255, 255, 0.07), rgba(20, 20, 25, 0.86));
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), inset 0 0 8px rgba(255, 255, 255, 0.05);
    outline: none;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.1s ease, border-color 0.18s ease, background 0.18s ease;
}
body.touch-device #mobile-scope-btn.active {
    border-color: rgba(120, 200, 255, 0.6);
    background: radial-gradient(circle, rgba(90, 170, 255, 0.18), rgba(20, 20, 25, 0.9));
}
body.touch-device #mobile-scope-btn:active { transform: scale(0.9); }

@media (max-width: 768px) {
    body.touch-device #mobile-scope-btn.mobile-visible {
        right: 168px;
        bottom: 24px;
        width: 52px;
        height: 52px;
    }
}

/* Mobil silah çek/kılıfa koy düğmesi — V tuşunun dokunmatik karşılığı.
   JS yalnız envanterde silah varken .mobile-visible sınıfını ekler. */
#mobile-weapon-toggle-btn { display: none; }
body.touch-device #mobile-weapon-toggle-btn.mobile-visible {
    display: flex;
    position: fixed;
    right: 180px;
    bottom: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    z-index: 3600;
    border: 1.5px solid rgba(255,255,255,.22);
    background: radial-gradient(circle, rgba(255,255,255,.07), rgba(20,20,25,.86));
    color: rgba(255,255,255,.9);
    box-shadow: 0 6px 20px rgba(0,0,0,.45), inset 0 0 8px rgba(255,255,255,.05);
    outline: none;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform .1s ease, border-color .18s ease, background .18s ease;
}
body.touch-device #mobile-weapon-toggle-btn svg { width: 25px; height: 25px; }
body.touch-device #mobile-weapon-toggle-btn.armed {
    border-color: rgba(255,190,105,.5);
    background: radial-gradient(circle, rgba(255,170,80,.14), rgba(20,20,25,.9));
}
body.touch-device #mobile-weapon-toggle-btn:not(.armed) .weapon-toggle-arrow {
    transform-origin: 12px 17px;
    transform: rotate(180deg);
}
body.touch-device #mobile-weapon-toggle-btn:active { transform: scale(.9); }
/* Sniper dürbünü düğmesi görünürken silah-indirme düğmesi bir kademe daha sola kayar
   (aksi halde scope düğmesiyle çakışırdı). JS scope görünürken .scope-var ekler. */
body.touch-device #mobile-weapon-toggle-btn.mobile-visible.scope-var { right: 248px; }

@media (max-width: 768px) {
    body.touch-device #mobile-weapon-toggle-btn.mobile-visible {
        right: 168px;
        bottom: 24px;
        width: 52px;
        height: 52px;
    }
    body.touch-device #mobile-weapon-toggle-btn.mobile-visible.scope-var { right: 232px; }
}

/* Sniper dürbünü açıkken (tam ekran karartma z-index:9500) dokunmatik kontroller
   görünür kalmalı — scope overlay'in üstüne çıkarılır. */
body.touch-device #joystick-container,
body.touch-device #mobile-shoot-btn,
body.touch-device #mobile-scope-btn.mobile-visible,
body.touch-device #mobile-jump-btn,
body.touch-device #mobile-crouch-btn,
body.touch-device #mobile-prone-btn,
body.touch-device #mobile-interact-btn,
body.touch-device #mobile-weapon-toggle-btn.mobile-visible {
    z-index: 9550;
}

/* Sürüş modundayken crosshair gizlensin */
body.is-driving #crosshair {
    display: none !important;
}
body.is-driving #weapon-crosshair {
    display: none !important;
}
/* Pickup silahçısı sürücü değildir: araç sınıfı kalsa da iki nişangâh açık kalır. */
body.is-driving.pickup-gunner #crosshair,
body.is-driving.pickup-gunner #weapon-crosshair {
    display: block !important;
    opacity: 1 !important;
}

/* Mobile Interact (E) Button Styles */
#mobile-interact-btn {
    display: none;
}

body.touch-device #mobile-interact-btn {
    display: flex;
    position: fixed;
    left: 140px; /* Joystick'e biraz yaklaştırıldı */
    bottom: 44px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, rgba(20, 20, 25, 0.85) 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), inset 0 0 8px rgba(255, 255, 255, 0.05);
    z-index: 3600;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    outline: none;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.1s ease, border-color 0.2s, background-color 0.2s;
}

body.touch-device #mobile-interact-btn span {
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 24px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

body.touch-device #mobile-interact-btn:active {
    transform: scale(0.9);
    border-color: rgba(255, 255, 255, 0.55);
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, rgba(20, 20, 25, 0.9) 100%);
}

@media (max-width: 768px) {
    body.touch-device #mobile-interact-btn {
        left: 108px;
        bottom: 32px;
        width: 52px;
        height: 52px;
    }
    body.touch-device #mobile-interact-btn span {
        font-size: 22px;
    }
}

/* Mobile Crouch Button Styles */
#mobile-crouch-btn {
    display: none;
}

body.touch-device #mobile-crouch-btn {
    display: flex;
    position: fixed;
    /* Egilme butonu JOYSTICK'IN USTUNDE (sol alt); eski sag-alt yerini
       surunme butonu (#mobile-prone-btn) aldi. */
    left: 51px;
    bottom: 150px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.06) 0%, rgba(20, 20, 25, 0.88) 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), inset 0 0 8px rgba(255, 255, 255, 0.05);
    z-index: 3600;
    justify-content: center;
    align-items: center;
    color: white;
    cursor: pointer;
    /* PERF: backdrop-filter kaldırıldı — oyun sırasında sürekli görünen buton,
       mobil GPU'da her kare canvas üzerinde blur kompozisyonu tetikliyordu.
       Görsel telafi: arka plan hafif koyulaştırıldı (0.8 → 0.88). */
    transition: transform 0.1s ease, border-color 0.2s, background-color 0.2s;
}

body.touch-device #mobile-crouch-btn:active,
body.touch-device #mobile-crouch-btn.active {
    transform: scale(0.9);
    border-color: rgba(255, 255, 255, 0.55);
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, rgba(20, 20, 25, 0.9) 100%);
}

@media (max-width: 768px) {
    body.touch-device #mobile-crouch-btn {
        left: 33px;
        bottom: 112px;
        width: 52px;
        height: 52px;
    }
}

/* Mobil Surunme (Z) Butonu - eski egilme butonunun yerinde */
#mobile-prone-btn {
    display: none;
}

body.touch-device #mobile-prone-btn {
    display: flex;
    position: fixed;
    right: 38px;
    bottom: 105px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.06) 0%, rgba(20, 20, 25, 0.88) 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), inset 0 0 8px rgba(255, 255, 255, 0.05);
    z-index: 3600;
    justify-content: center;
    align-items: center;
    color: white;
    cursor: pointer;
    transition: transform 0.1s ease, border-color 0.2s, background-color 0.2s;
}

body.touch-device #mobile-prone-btn:active,
body.touch-device #mobile-prone-btn.active {
    transform: scale(0.9);
    border-color: rgba(255, 255, 255, 0.55);
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, rgba(20, 20, 25, 0.9) 100%);
}

@media (max-width: 768px) {
    body.touch-device #mobile-prone-btn {
        right: 28px;
        bottom: 90px;
        width: 52px;
        height: 52px;
    }
}
