@import url('https://fonts.googleapis.com/css2?family=Roboto&display=swap');

:root {
  --box-count: 8;
  --header-height: 18px;
  --padding-vertical: 4px;
  --gap: 2px;
  --total-gap: calc((var(--box-count) - 1) * var(--gap));

  /* MOBİL DİKEY İÇİN KULLANILACAK AYARLAR */
  --box-min-height-mobile-portrait: 80px;
  --box-flex-grow-mobile-portrait: 1;
  --value-font-size-min-mobile-portrait: 18px;
  --value-font-size-max-mobile-portrait: 40px;
  --label-font-size-min-mobile-portrait: 8px;
  --label-font-size-max-mobile-portrait: 18px;

  /* MOBİL YATAY VE BİLGİSAYAR İÇİN ORİJİNAL KORUNAN AYARLAR */
  --box-height-responsive: calc((100vh - 30px - 20px) / 4); /* Bu hem yatay mobil hem de bilgisayar için kullanılacak */
  --header-height-desktop: 30px;
  --h1-font-size-desktop: 1.2rem;
}

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

html, body {
  height: 100%;
  overflow: hidden; /* Genel sayfa kaydırmasını engeller */
}

body {
  font-family: 'Roboto', sans-serif;
  background: #121212;
  color: #00d8d6;
  display: flex;
  flex-direction: column;
  padding: 2px 2px;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  touch-action: manipulation;
}

h1 {
  font-size: 0.9rem;
  text-align: center;
  margin: 2px 0;
  padding: 0;
  height: var(--header-height);
  flex-shrink: 0;
}

.anatolya-scroll {
  flex: 1; /* Kalan dikey alanı kaplar */
  display: flex;
  flex-direction: column; /* Mobil dikey için varsayılan olarak dikey sıralama */
  gap: var(--gap);
  justify-content: flex-start;
  
  /* MOBİL DİKEY İÇİN KAYDIRMA AYARI */
  overflow-y: auto; /* İçerik sığmadığında dikey kaydırma çubuğu belirir */
  overflow-x: hidden; /* Yatay kaydırmayı engeller */
  -webkit-overflow-scrolling: touch; /* iOS cihazlarda daha akıcı kaydırma */
}

.anatolya-box {
  background: #222;
  border-radius: 5px;
  text-align: center;
  width: 100%;
  /* MOBİL DİKEY KUTU AYARLARI */
  min-height: var(--box-min-height-mobile-portrait);
  flex-grow: var(--box-flex-grow-mobile-portrait);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 3px;
  box-sizing: border-box;
}

.anatolya-label {
  /* MOBİL DİKEY LABEL FONT BOYUTU */
  font-size: clamp(var(--label-font-size-min-mobile-portrait), 3vw, var(--label-font-size-max-mobile-portrait));
  color: #888;
  line-height: 1.1;
  height: 28%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anatolya-value {
  /* MOBİL DİKEY VALUE FONT BOYUTU */
  font-size: clamp(var(--value-font-size-min-mobile-portrait), 7vw, var(--value-font-size-max-mobile-portrait));
  font-weight: bold;
  letter-spacing: 0.05em;
  line-height: 1;
  height: 72%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-width: 12ch;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* --- MOBİL YATAY EKRAN AYARLARI (tabletler dahil) --- */
/* Geniş ekranlı ancak dokunmatik ve kaba işaretleyicili cihazlar (mobil yatay, bazı tabletler) */
@media (min-width: 600px) and (hover: none) and (pointer: coarse) {
  :root {
    --box-height: var(--box-height-responsive);
    --value-font-size: calc(var(--box-height) * 0.36);
    --label-font-size: calc(var(--box-height) * 0.13);
  }

  h1 {
    height: var(--header-height-desktop);
    font-size: var(--h1-font-size-desktop);
    margin-bottom: 5px;
  }

  .anatolya-scroll {
    flex-direction: row; /* Yatayda iki sütun için */
    flex-wrap: wrap;
    justify-content: center;
    align-content: flex-start;
    gap: 6px;
    overflow-y: auto; /* İhtiyaç halinde kaydırma çubuğu belirir */
  }

  .anatolya-box {
    width: calc(50% - 3px); /* İki sütun için %50 genişlik */
    height: var(--box-height);
    min-height: 60px;
    flex-grow: 0;
  }

  .anatolya-label {
    font-size: var(--label-font-size);
    height: 25%;
    white-space: normal;
    text-overflow: clip;
  }

  .anatolya-value {
    font-size: var(--value-font-size);
    height: 75%;
    white-space: normal;
    text-overflow: clip;
  }
}

/* --- BİLGİSAYAR EKRANI İÇİN (768px ve üzeri) AYARLAR --- */
/* Sadece fare gibi hassas işaretleyicili ve hover yeteneği olan cihazlar (masaüstü/laptop) */
@media (min-width: 768px) and (hover: hover) and (pointer: fine) {
  :root {
    --box-height: var(--box-height-responsive); /* Bilgisayar için de bu yüksekliği kullan */
    --value-font-size: calc(var(--box-height) * 0.36);
    --label-font-size: calc(var(--box-height) * 0.13);
  }

  h1 {
    height: var(--header-height-desktop);
    font-size: var(--h1-font-size-desktop);
    margin-bottom: 5px;
  }

  .anatolya-scroll {
    flex-direction: row; /* Bilgisayar için yatay sıralama */
    flex-wrap: wrap;
    justify-content: center;
    align-content: flex-start;
    gap: 6px;
    /* BİLGİSAYARDA TAM EKRANDA KAYDIRMA ÇUBUĞUNU GİZLE */
    overflow-y: hidden; 
  }

  .anatolya-box {
    width: calc(50% - 3px);
    height: var(--box-height);
    min-height: 60px;
    flex-grow: 0;
  }

  .anatolya-label {
    font-size: var(--label-font-size);
    height: 25%;
    white-space: normal;
    text-overflow: clip;
  }

  .anatolya-value {
    font-size: var(--value-font-size);
    height: 75%;
    white-space: normal;
    text-overflow: clip;
  }
}
