/* ============================================================
   SODP — Cross-platform CSS
   iOS Safari, Android Chrome, desktop tüm platformlar
   ============================================================ */

/* --- TEMEL RESET --- */
*, *::before, *::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    /* iOS Safari %100 yükseklik için kritik */
    height: -webkit-fill-available;
    height: 100%;
    width: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

body, html {
    overscroll-behavior: none;
    touch-action: none;
    overflow: hidden;
    /* iOS rubber-band scroll'u engelle */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
}

body {
    /*
      iOS Safe Area (notch / Dynamic Island / home bar) desteği
      env() değerleri desteklenmiyorsa 0 olarak fallback alır
    */
    padding-top:    env(safe-area-inset-top,    0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left:   env(safe-area-inset-left,   0px);
    padding-right:  env(safe-area-inset-right,  0px);

    /*
      Yükseklik sıralaması (tarayıcı desteğine göre en iyi birini seçer):
      1. dvh  — modern (iOS 16+, Android Chrome 108+)
      2. svh  — small viewport height (klavye açıkken küçülmez)
      3. -webkit-fill-available — eski iOS Safari
      4. 100vh — son fallback
    */
    min-height: 100vh;
    min-height: 100svh;
    min-height: -webkit-fill-available;
    min-height: 100dvh;

    display: flex;
    flex-direction: column;
}

/* --- HEADER: Safe area farkında --- */
#gameHeader {
    /* Notch olan cihazlarda header üstü safe area kadar padding alır */
    padding-top: env(safe-area-inset-top, 0px);
}

/* --- MAIN ALAN --- */
main {
    flex: 1;
    min-height: 0; /* flexbox overflow fix */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* --- OYUN WRAPPER --- */
#gameWrapper {
    /*
      Tam ekran dolumu: header yüksekliği (56px) + safe area çıkar
      Wrapper kendi içini yönetir
    */
    flex-shrink: 0;
}

/* --- CANVAS: piksel-mükemmel ölçekleme --- */
#bureaucracyCanvas {
    display: block;
    /* object-fit yerine JS ile boyutlandırıyoruz ama fallback olarak kalıyor */
    image-rendering: pixelated;
    image-rendering: -webkit-optimize-contrast; /* Safari */
    image-rendering: crisp-edges;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* --- CRT EFEKTİ --- */
.crt-overlay {
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.15) 50%);
    background-size: 100% 4px;
    pointer-events: none;
}

/* --- ANİMASYONLAR --- */
.stamp-animation {
    animation: stampHit 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    opacity: 0;
    transform: scale(3) rotate(-20deg);
}
@keyframes stampHit {
    to { opacity: 0.9; transform: scale(1) rotate(-12deg); }
}

.animate-modal-pop {
    animation: modalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
    transform: scale(0.8);
}
@keyframes modalPop {
    to { opacity: 1; transform: scale(1); }
}

@keyframes shine {
    100% { left: 125%; }
}
.animate-shine {
    animation: shine 1.5s infinite;
}

/* --- iOS SCROLL BOUNCE ÖNLEME --- */
.overflow-hidden {
    -webkit-overflow-scrolling: auto !important;
}