/* Lumi V3 — 3. sınıf ders bazında ekran optimizasyonu.
   Yalnız bu sınıfın tahta sınıflarına kapsamlı kurallar. Orijinal ders dosyalarına dokunulmaz. */

/* ===== grade3Division (Bölme İşlemi, Bölüm ve Kalan) ===== */
/* Yazılı bölme kartı: küçük kalıyordu -> gerçek yerleşimli büyütme (kart yalnız görsel, tıklanır öğe yok) */
#app:not(#lumi-z) .lesson-shell[data-grade="3"]:has(#teaching-board.grade3-division-board) .g3div-written-work { zoom: 1.9; }
@media (min-width: 761px) and (max-height: 799px) {
  #app:not(#lumi-z) .lesson-shell[data-grade="3"]:has(#teaching-board.grade3-division-board) .g3div-written-work { zoom: 1.55; }
}
@media (max-width: 760px) {
  #app:not(#lumi-z) .lesson-shell[data-grade="3"]:has(#teaching-board.grade3-division-board) .g3div-written-work { zoom: 1.25; }
}
/* Çalışma haritası: geniş ekranda tahtayı doldursun */
@media (min-width: 761px) {
  #app:not(#lumi-z) .lesson-shell[data-grade="3"]:has(#teaching-board.grade3-division-board) .g3div-work-map { padding: 18px 20px !important; gap: 10px !important; justify-content: flex-start !important; }
  #app:not(#lumi-z) .lesson-shell[data-grade="3"]:has(#teaching-board.grade3-division-board) .g3div-work-map h2 { font-size: 24px !important; }
  #app:not(#lumi-z) .lesson-shell[data-grade="3"]:has(#teaching-board.grade3-division-board) .g3div-work-map p { font-size: 15px !important; }
  #app:not(#lumi-z) .lesson-shell[data-grade="3"]:has(#teaching-board.grade3-division-board) .g3div-map-grid { flex: 1 1 auto !important; min-height: 0 !important; grid-auto-rows: minmax(52px, 1fr) !important; gap: 10px !important; margin-top: 4px; }
  #app:not(#lumi-z) .lesson-shell[data-grade="3"]:has(#teaching-board.grade3-division-board) .g3div-map-grid button { display: flex !important; align-items: center !important; height: auto !important; min-height: 52px !important; font-size: 16px !important; padding: 6px 12px !important; }
}

/* ===== 3. sınıf geneli: kısa yatay ekranda (dizüstü / yatay tablet) tahta masaüstü tasarım ölçüsünde (760 px) kurulur.
   Eski "100vh - 205px" genişlik/yükseklik sınırı tahtayı küçültüp içeriği kesiyordu; ölçekleme sığdırma motorunda. ===== */
@media (min-width: 761px) and (max-height: 899px) {
  #app:not(#lumi-z) .lesson-shell[data-grade="3"] .teaching-area { width: 760px !important; }
  #app:not(#lumi-z) .lesson-shell[data-grade="3"] #teaching-board > :only-child { max-height: none !important; }
}
/* Retain a 44px rendered target after the short-laptop stage fit. */
@media(min-width:900px) and (max-height:799px) {
 #app:not(#lumi-z) .lesson-shell[data-grade="3"][data-screen-number^="89-08-"] #lesson-footer button[data-g3tf-frequency] { min-height:48px !important; }
}

/* Critical mobile layout corrections verified against release 20261018-games-v1.
   Preserve lesson answers, progression and narration. */
#app:not(#lumi-z) #teaching-board :is(.g3div-work-map, .rel-work-map) {
  overflow: auto !important;
  justify-content: flex-start !important;
  overscroll-behavior: contain;
}
#app:not(#lumi-z) #teaching-board .g3dp-workspace {
  grid-template-columns: minmax(0, 1fr);
}
#app:not(#lumi-z) #teaching-board .g3dp-workspace > div {
  min-width: 0;
  max-width: 100%;
}
#app:not(#lumi-z) #teaching-board .g3dp-workspace > div:not(.g3dp-same-done) {
  grid-template-columns: minmax(0, 1fr);
}
@media (max-width: 620px) and (max-height: 700px) {
  /* The stage fit scales these footers on short phones. Size the actual
     controls before fitting so their final height still exceeds 44px. */
  #app:not(#lumi-z):has(.g3id-lab) #lesson-footer button,
  #app:not(#lumi-z):has(.g3dp-lab) #lesson-footer button,
  #app:not(#lumi-z):has(.g3div-share-build) #lesson-footer button {
    min-height: 54px !important;
  }
}
@media (max-width: 700px) {
  #app:not(#lumi-z) #teaching-board .g3dp-route {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  #app:not(#lumi-z) #teaching-board .g3dp-route > em { display: none; }
  #app:not(#lumi-z) #teaching-board .g3dp-workspace {
    overflow: auto;
    overscroll-behavior: contain;
  }
  /* V3's generic board bold-text size must not expand compact rail labels. */
  #app:not(#lumi-z) #teaching-board .g3id-decision-rail > b {
    font-size: 12px !important;
    line-height: 1.15 !important;
    overflow-wrap: anywhere;
  }
  #app:not(#lumi-z) #teaching-board .g3id-lens-panel b {
    font-size: 10px !important;
    line-height: 1.15 !important;
  }
  #app:not(#lumi-z) #teaching-board .g3id-lens-panel small {
    /* Decorative title duplicates the panel aria-label. Runtime readable-min
       enlargement otherwise pushes the actual research question out. */
    display: none;
  }
  /* Reserve 72px for the evidence rail plus the existing 348px content card. */
  #app:not(#lumi-z) #teaching-board.grade3-interpret-data-board {
    height: 450px !important;
    min-height: 450px !important;
    max-height: none !important;
  }
  #app:not(#lumi-z) #teaching-board .g3id-workspace,
  #app:not(#lumi-z) #teaching-board .g3id-workspace > div:not(.g3id-alternative) {
    overflow: auto;
    overscroll-behavior: contain;
  }
}
@media (min-width: 821px) {
  /* Leave room for the final desktop stage fit without reducing grid hits
     below 44px. The square grid retains its aspect ratio. */
  #app:not(#lumi-z) #teaching-board .g3t5a-lab .grade3-grid-scroll > .g3cs-grid {
    width: 400px !important;
    min-width: 400px !important;
  }
}
@media (min-width: 821px) and (max-height: 800px) {
  #app:not(#lumi-z):has(.g3id-lab) #lesson-footer button,
  #app:not(#lumi-z):has(.g3dp-lab) #lesson-footer button {
    min-height: 48px !important;
  }
}
@media (max-width: 620px) {
  /* The fruit distribution is 420px tall; the old 370px board clipped both
     stock heading and conservation equation. Reserve its natural height. */
  #app:not(#lumi-z) #teaching-board.grade3-division-board:has(.g3div-share-build) {
    height: 440px !important;
    min-height: 440px !important;
    max-height: none !important;
  }
  /* The theme-5 task has a 428px minimum while the mobile stage is shorter.
     Keep its real grid target sizes and allow its heading/actions to be reached. */
  #app:not(#lumi-z) #teaching-board .g3t5a-workspace {
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  #app:not(#lumi-z) #teaching-board .g3t5a-workspace .g3code-command {
    min-height: 46px !important;
  }
  /* Five chain cards need real, separate 44px targets even at 360px width.
     SVG coordinates: 130px height, 140px row pitch in a 1000px canvas. */
  #app:not(#lumi-z) #teaching-board.tu-astra [data-chain] > rect { height: 130px; }
  #app:not(#lumi-z) #teaching-board.tu-astra [data-chain] > text { translate: 0 19px; }
  #app:not(#lumi-z) #teaching-board.tu-astra [data-chain="1"] { translate: 0 25px; }
  #app:not(#lumi-z) #teaching-board.tu-astra [data-chain="2"] { translate: 0 50px; }
  #app:not(#lumi-z) #teaching-board.tu-astra [data-chain="3"] { translate: 0 75px; }
  #app:not(#lumi-z) #teaching-board.tu-astra [data-chain="4"] { translate: 0 100px; }
}
  /* Bottom clock face otherwise crosses the square board edge. Keep all three
     choices the same size and retain their original centers. */
  #app:not(#lumi-z) #teaching-board.clk-astra .clk-face[role="button"] {
    transform-box: view-box;
    transform-origin: 0 0;
  }
  #app:not(#lumi-z) #teaching-board.clk-astra [data-clock="choice-1"] { transform: translate(257px, 449px) scale(.61); }
  #app:not(#lumi-z) #teaching-board.clk-astra [data-clock="choice-2"] { transform: translate(743px, 449px) scale(.61); }
  #app:not(#lumi-z) #teaching-board.clk-astra [data-clock="choice-3"] { transform: translate(500px, 788px) scale(.61); }
