/* Piksel Depocu — arayüz. Renkler src/palet.js'ten CSS değişkenine yazılır (main.js). */
:root {
  --arka: #14131f;
  --panel: #24233a;
  --metin: #f4f4f4;
  --soluk: #8b89a8;
  --vurgu: #ffcd75;
  --basari: #38b764;
  --font: ui-monospace, "Cascadia Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--arka); color: var(--metin); font-family: var(--font); }
body { overflow: hidden; overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
#uygulama { position: fixed; inset: 0; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.ekran { position: absolute; inset: 0; }
[hidden] { display: none !important; }

.dugme {
  font: inherit; font-weight: 700; color: var(--metin); background: var(--panel);
  border: 2px solid var(--soluk); border-radius: 6px; padding: 10px 14px; min-height: 48px; min-width: 48px; cursor: pointer;
  box-shadow: 0 3px 0 #0008;
}
.dugme:active { transform: translateY(2px); box-shadow: 0 1px 0 #0008; }
.dugme.buyuk { background: var(--vurgu); color: #1a1c2c; border-color: #1a1c2c; font-size: 1.15rem; padding: 12px 28px; }
.dugme:disabled { opacity: .4; cursor: default; }
.dugme:focus-visible, .dp:focus-visible, .seviye:focus-visible { outline: 3px solid var(--vurgu); outline-offset: 2px; }

/* Başlık */
#ekran-baslik { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px 16px; text-align: center; }
#baslik-sahne { width: 288px; height: 48px; image-rendering: pixelated; }
#ekran-baslik h1 { margin: 0; font-size: clamp(2rem, 9vw, 3.4rem); letter-spacing: 2px; color: var(--vurgu); text-shadow: 3px 3px 0 #7a4a2a; }
#ekran-baslik .alt { margin: 0 0 12px; color: var(--soluk); }
#ekran-baslik .nasil { max-width: 34ch; color: var(--soluk); font-size: .9rem; line-height: 1.4; margin-top: 12px; }

/* Seviye seçimi */
#ekran-secim { display: flex; flex-direction: column; padding: 12px 16px; }
.ust { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ust h2 { flex: 1; margin: 0; font-size: 1.3rem; }
.toplam-yildiz { color: var(--vurgu); font-weight: 700; }
.seviye-izgara { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(5, minmax(48px, 1fr)); grid-auto-rows: 64px; gap: 10px; align-content: start; overflow-y: auto; max-width: 560px; width: 100%; margin: 0 auto; padding: 2px; }
.seviye {
  font: inherit; height: 100%; min-height: 48px; border-radius: 8px; border: 2px solid var(--soluk); background: var(--panel); color: var(--metin);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; font-weight: 700; font-size: 1.1rem; padding: 2px;
}
.seviye small { font-size: .7rem; color: var(--vurgu); letter-spacing: 1px; min-height: 1em; }
.seviye.bitti { border-color: var(--basari); }
/* PD-EKSIK-2 v2: göçle "devir" alan (oynanmamış) seviye: iç kesik çizgi + soluk yıldız */
.seviye.bitti.devir { outline: 2px dashed var(--soluk); outline-offset: -7px; }
.seviye.devir small { opacity: .45; }
/* PD-9b: çözümü izlenen seviye — sağ üstte küçük piksel göz */
.seviye { position: relative; }
.seviye .izlendi-isaret { position: absolute; top: 2px; right: 2px; width: 13px; height: 9px; image-rendering: pixelated;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 5' shape-rendering='crispEdges'%3E%3Cpath fill='%2314161c' d='M2 0h3v1h1v1h1v1h-1v1h-1v1h-3v-1h-1v-1h-1v-1h1v-1h1z'/%3E%3Cpath fill='%23e8eef7' d='M2 1h3v1h1v1h-1v1h-3v-1h-1v-1h1z'/%3E%3Cpath fill='%2335a7ff' d='M3 1h1v3h-1z'/%3E%3C/svg%3E") center / contain no-repeat; pointer-events: none; }
/* PD-ATLA-1: atlanan (henüz bitirilmemiş) seviye — numara vurgu renginde + yıldız satırında ▶▶| piksel işaret
   (kenar index.html'deki 9-slice border-image'dan gelir; border-style/color burada etkisiz) */
.seviye.atlandi span { color: var(--vurgu); }
.seviye .atlandi-isaret { display: block; width: 18px; height: 10px; image-rendering: pixelated; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 5' shape-rendering='crispEdges'%3E%3Cpath fill='%23ffcd75' d='M0 0h1v1h1v1h1v1h-1v1h-1v1h-1zM4 0h1v1h1v1h1v1h-1v1h-1v1h-1zM8 0h1v5h-1z'/%3E%3C/svg%3E") center / contain no-repeat; }
.paket-atlanan { color: var(--vurgu); }
.seviye:disabled { opacity: .35; cursor: default; }
.seviye:disabled small { color: var(--soluk); }

/* Oyun ekranı: dikeyde üst HUD / tahta / alt D-pad; yatayda sol HUD / tahta / sağ-alt D-pad */
#ekran-oyun { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "hud" "tahta" "kontrol"; }
.hud { grid-area: hud; padding: 8px 12px 4px; display: flex; flex-direction: column; gap: 6px; }
.istatistik { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.istatistik div { background: var(--panel); border-radius: 6px; padding: 4px 6px; display: flex; flex-direction: column; align-items: center; }
.istatistik span { font-size: .68rem; color: var(--soluk); text-transform: uppercase; }
.istatistik b { font-size: 1.1rem; }
.hud-dugmeler { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.hud-dugmeler .dugme { padding: 6px 4px; font-size: .9rem; }
.tahta-alan { grid-area: tahta; position: relative; min-height: 0; min-width: 0; touch-action: none; }
#tahta { position: absolute; left: 0; top: 0; image-rendering: pixelated; } /* PD-5: boyut/konum main.js (sanatYerlesimi) */
.kontrol { grid-area: kontrol; display: flex; justify-content: center; align-items: flex-end; padding: 4px 12px 10px; }
.dpad { display: grid; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(3, 56px); gap: 4px; grid-template-areas: ". u ." "l . r" ". d ."; }
.dp { border: 2px solid var(--soluk); border-radius: 10px; background: var(--panel); cursor: pointer; position: relative; touch-action: manipulation; }
.dp:active { background: var(--soluk); }
.dp::after { content: ""; position: absolute; left: 50%; top: 50%; border: calc(var(--dp, 48px) * .2) solid transparent; transform: translate(-50%, -50%); }
.dp-u { grid-area: u; } .dp-u::after { border-bottom: calc(var(--dp, 48px) * .29) solid var(--metin); border-top-width: 0; }
.dp-d { grid-area: d; } .dp-d::after { border-top: calc(var(--dp, 48px) * .29) solid var(--metin); border-bottom-width: 0; }
.dp-l { grid-area: l; } .dp-l::after { border-right: calc(var(--dp, 48px) * .29) solid var(--metin); border-left-width: 0; }
.dp-r { grid-area: r; } .dp-r::after { border-left: calc(var(--dp, 48px) * .29) solid var(--metin); border-right-width: 0; }

@media (orientation: landscape) {
  .seviye-izgara { grid-template-columns: repeat(10, minmax(48px, 1fr)); grid-auto-rows: 64px; max-width: 820px; }
  #ekran-oyun { grid-template-rows: minmax(0, 1fr); grid-template-columns: 150px minmax(0, 1fr) 184px; grid-template-areas: "hud tahta kontrol"; }
  .hud { padding: 8px 6px 8px 10px; justify-content: flex-start; }
  .istatistik { grid-template-columns: 1fr 1fr; }
  .hud-dugmeler { grid-template-columns: 1fr; }
  .kontrol { align-items: flex-end; justify-content: flex-end; padding: 8px 10px 10px 4px; }
}
@media (orientation: landscape) and (max-height: 420px) {
  #ekran-secim { padding: 8px 16px; }
  .ust { margin-bottom: 8px; }
  .seviye-izgara { grid-auto-rows: 56px; gap: 8px; }
  .istatistik div { padding: 2px 4px; }
  .hud-dugmeler .dugme { min-height: 44px; }
}

/* Kazanma kartı */
.kart-perde { position: absolute; inset: 0; background: #0009; display: flex; align-items: center; justify-content: center; padding: 16px; }
.kart { background: var(--panel); border: 3px solid var(--vurgu); border-radius: 10px; padding: 18px 22px; text-align: center; min-width: 240px; box-shadow: 0 6px 0 #0008; }
.kart h2 { margin: 0 0 6px; color: var(--vurgu); }
.yildizlar { font-size: 2.2rem; letter-spacing: 6px; color: var(--vurgu); }
.yildizlar .bos { color: #5d5b7a; }
.kart-satir { margin: 4px 0; }
.kart-dugmeler { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 12px; }
/* PD-110: 1-2★ bitiş — fark satırı + Tekrar birincil (sarı, sağda), Sonraki ikincil (panel rengi); 3★'da bugünkü düzen */
.kart-fark { color: var(--vurgu); font-weight: 700; overflow-wrap: anywhere; }
#kazanma[data-tekrar-onde] #kart-tekrar { background: var(--vurgu); color: #1a1c2c; border-color: #1a1c2c; order: 3; }
#kazanma[data-tekrar-onde] #kart-sonraki { background: var(--panel); color: var(--metin); border-color: var(--soluk); font-size: 1rem; padding: 10px 14px; order: 2; }
/* PD-110: çıkmazda ipucu düğmesi "N hamle geri al" — telefonda simge + "↶N" (tam cümle aria-label + mesaj satırında), sarı nabız */
#dugme-ipucu[data-karar="cikmaz"] { border-color: var(--vurgu); box-shadow: 0 0 0 3px var(--vurgu); animation: geri-al-nabiz .9s ease-in-out infinite; }
html[data-cihaz="masaustu"] .hud-dugmeler #dugme-ipucu[data-karar="cikmaz"] { font-size: .8rem; white-space: normal; }
html:not([data-cihaz="masaustu"]) #ekran-oyun .hud-dugmeler #dugme-ipucu[data-karar="cikmaz"] { font-size: 0 !important; gap: 0; white-space: nowrap; }
html:not([data-cihaz="masaustu"]) #ekran-oyun .hud-dugmeler #dugme-ipucu[data-karar="cikmaz"]::after { content: attr(data-kalan); font-size: .75rem; line-height: 1.1; }
@media (prefers-reduced-motion: reduce) { #dugme-ipucu[data-karar="cikmaz"] { animation: none; } }

.durum-mesaj { position: absolute; left: 0; right: 0; bottom: 16px; text-align: center; color: var(--soluk); margin: 0; }

/* PD-MENU-1: ana menü — depo sahnesi, altın logo (1b: harf itme açılışı), ahşap düğmeler. Varlıklar art/menu/ (menu_uret.py,
   oyunun 24 renk paleti). Pikseller tamsayı ölçekte: sahne 2x, ön kasalar 3x, logo + işçi 2x, ikonlar 2x. Animasyonlar steps(). */
#ekran-baslik {
  --m-k1: #2e1f2e; --m-k2: #4a2f3a; --m-k3: #6b4245; --m-t3: #a8828a; --m-c3: #f0be6e; --m-c4: #fff0b8; --m-g3: #b2ec86;
  isolation: isolate; overflow-x: hidden; background: var(--m-k1);
}
#ekran-baslik .menu-sahne { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
#ekran-baslik .sahne-arka, #ekran-baslik .sahne-on, #ekran-baslik .tozlar { position: absolute; image-rendering: pixelated; }
#ekran-baslik .sahne-arka { inset: 0 -12px; background: url(../art/menu/sahne-arka.png) center center / 480px 920px repeat-x;
  animation: menu-kay-arka 20s steps(2, jump-none) infinite alternate; }
#ekran-baslik .sahne-on { left: -12px; right: -12px; bottom: 0; height: 330px; animation: menu-kay-on 20s steps(3, jump-none) infinite alternate; }
#ekran-baslik .sahne-on::before, #ekran-baslik .sahne-on::after { content: ""; position: absolute; bottom: 0; width: 50%; height: 100%;
  background: url(../art/menu/sahne-on.png) left bottom / 360px 330px no-repeat; image-rendering: pixelated; }
#ekran-baslik .sahne-on::before { left: 0; }
#ekran-baslik .sahne-on::after { right: 0; background-position: right bottom; }
@keyframes menu-kay-arka { from { transform: translateX(-2px); } to { transform: translateX(2px); } }
@keyframes menu-kay-on { from { transform: translateX(6px); } to { transform: translateX(-6px); } }
#ekran-baslik .tozlar { inset: 0; }
#ekran-baslik .toz { position: absolute; width: 6px; height: 6px; opacity: 0; image-rendering: pixelated;
  background: url(../art/menu/toz-1.png) 0 0 / 6px 6px; animation: menu-suzul var(--s, 9s) steps(30) infinite; animation-delay: var(--g, 0s); }
#ekran-baslik .toz.k { width: 4px; height: 4px; background-image: url(../art/menu/toz-2.png); background-size: 4px 4px; }
@keyframes menu-suzul { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: .9; } 80% { opacity: .7; } 100% { transform: translate(24px, 60px); opacity: 0; } }
#ekran-baslik .logo { animation: menu-sallan 3s steps(1) infinite; }
@keyframes menu-sallan { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
#ekran-baslik #baslik-sahne { display: none; }   /* eski 96x16 şerit (main.js çizmeye devam eder) */
/* PD-MENU-1b: logo sahnesi — gövde <img> + harf / parıltı / işçi katmanı (src/menu-anim.js). Konumlar logo pikseli
   (--x, --y, --w, --h, kare --f); 1 logo pikseli = --lp (2x; yatay kısa ekranda 1x). EN tuvali 165 px (PIXEL DEPOCU + işçinin yeri). */
#ekran-baslik .logo-sahne { position: relative; --lp: 2px; }
#ekran-baslik .logo-en { width: 330px; }
#ekran-baslik .logo-sahne > img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
#ekran-baslik .logo-sahne > i { display: none; position: absolute; left: 0; top: 0; image-rendering: pixelated; background-repeat: no-repeat;
  transform: translate(calc(var(--x, 0) * var(--lp)), calc(var(--y, 0) * var(--lp))); }
#ekran-baslik .logo-sahne.canli > i { display: block; }
#ekran-baslik .logo-sahne.oynuyor { animation: none; }
#ekran-baslik .lg-kelime, #ekran-baslik .lg-par { width: calc(var(--w) * var(--lp)); height: calc(var(--h) * var(--lp));
  background-position: calc(var(--f, 0) * var(--w) * -1 * var(--lp)) 0; }
#ekran-baslik .lg-kelime { background-size: calc(2 * var(--w) * var(--lp)) 100%; }
#ekran-baslik .lg-par { background-size: calc(3 * var(--w) * var(--lp)) 100%; visibility: hidden; }
#ekran-baslik .lg-par.acik { visibility: visible; }
#ekran-baslik .logo-tr .lg-kelime { background-image: url(../art/menu/logo-tr-kelime.png); }
#ekran-baslik .logo-en .lg-kelime { background-image: url(../art/menu/logo-en-kelime.png); }
#ekran-baslik .logo-tr .lg-par { background-image: url(../art/menu/logo-tr-parilti.png); }
#ekran-baslik .logo-en .lg-par { background-image: url(../art/menu/logo-en-parilti.png); }
/* işçi: 6 kare x 20x24 logo pikseli (it0, it1, dur, geri, bek0, bek1) */
#ekran-baslik .lg-isci { width: calc(20 * var(--lp)); height: calc(24 * var(--lp)); background: url(../art/menu/isci-logo.png) no-repeat
  calc(var(--f, 4) * -20 * var(--lp)) 0 / calc(120 * var(--lp)) 100%; }
#ekran-baslik .lg-isci.bekle { animation: lg-nefes 1.2s steps(1) infinite; }   /* 2 kare nefes (bek0 / bek1) */
@keyframes lg-nefes { 0% { background-position-x: calc(-80 * var(--lp)); } 50% { background-position-x: calc(-100 * var(--lp)); } }
#ekran-baslik .alt { color: var(--m-c3); text-shadow: 0 2px 0 var(--m-k1), 0 0 6px var(--m-k1); }
#ekran-baslik .nasil { color: var(--m-c3); opacity: .85; text-shadow: 0 2px 0 var(--m-k1), 0 0 8px var(--m-k1); }
#ekran-baslik .px-ikon { image-rendering: pixelated; flex: none; }
#ekran-baslik .baslik-sayac { background: none; border-radius: 0; padding: 2px 10px; color: var(--m-c3); border: 6px solid transparent;
  border-image: url(../art/menu/kucuk-9.png) 3 fill / 6px / 0 stretch; image-rendering: pixelated; }
#ekran-baslik .baslik-sayac .ayrac { color: var(--m-t3); }
/* ahşap ana düğmeler (Oyna / Devam): 9-slice 3 px, 2x; tahta damarı merkezde tekrar eder */
#ekran-baslik .dugme.buyuk { min-width: 200px; min-height: 60px; padding: 4px 34px 8px; font-size: 1.45rem; font-weight: 800; letter-spacing: 1px;
  color: var(--m-k1); background: none; border: 6px solid transparent; border-radius: 0; box-shadow: none;
  border-image: url(../art/menu/oyna-9.png) 3 fill / 6px / 0 repeat; image-rendering: pixelated;
  text-shadow: 0 2px 0 var(--m-c3); filter: drop-shadow(0 4px 0 var(--m-k1)); position: relative; }
#ekran-baslik .dugme.buyuk.devam { font-size: 1.2rem; }
/* ISTEK 136-B: Oyna köşesinde seviye rozeti — sayaçla aynı aile (kucuk-9 çerçeve, açık krem metin); bitince kupa ikonu */
#ekran-baslik .oyna-rozet { position: absolute; top: -16px; right: -14px; min-width: 34px; padding: 0 4px; font-size: 1rem; line-height: 22px;
  letter-spacing: 0; text-align: center; color: var(--m-c3); text-shadow: 0 2px 0 var(--m-k1); border: 6px solid transparent;
  border-image: url(../art/menu/kucuk-9.png) 3 fill / 6px / 0 stretch; image-rendering: pixelated; pointer-events: none; }
#ekran-baslik .oyna-rozet[data-tip="kupa"]::after { content: ""; display: inline-block; width: 16px; height: 16px; vertical-align: -3px;
  background: url(../art/menu/ikon-basarim.png) 0 0 / 16px 16px no-repeat; image-rendering: pixelated; }
#ekran-baslik .dugme.buyuk::before, #ekran-baslik .dugme.buyuk::after { content: ""; position: absolute; top: 50%; width: 6px; height: 6px; margin-top: -3px;
  background: var(--m-k3); box-shadow: 0 2px 0 var(--m-c3); }
#ekran-baslik .dugme.buyuk::before { left: 6px; } #ekran-baslik .dugme.buyuk::after { right: 6px; }
#ekran-baslik .dugme.buyuk:active { transform: translateY(2px); filter: drop-shadow(0 2px 0 var(--m-k1)); box-shadow: none; }
#ekran-baslik .gunluk-kart { min-height: 60px; padding: 4px 8px; background: none; border: 6px solid transparent; border-radius: 0; box-shadow: none;
  border-image: url(../art/menu/kart-9.png) 3 fill / 6px / 0 stretch; image-rendering: pixelated; filter: drop-shadow(0 3px 0 var(--m-k1)); }
#ekran-baslik .gunluk-kart .px-ikon { width: 32px; height: 32px; }
#ekran-baslik .gunluk-kart b { color: var(--m-c4); }
#ekran-baslik .gunluk-kart small { color: var(--m-t3); }
#ekran-baslik .gunluk-kart .gk-eylem { color: var(--m-g3); max-width: 34%; }
#ekran-baslik .gunluk-kart[data-cozuldu="1"] { border-image-source: url(../art/menu/kucuk-9.png); }
#ekran-baslik .gunluk-kart[data-cozuldu="1"] .gk-eylem { color: var(--m-t3); }
/* PD-111: 3. bölümden önce kilitli günlük: çözüldü kartıyla aynı sönük çerçeve, soluk simge */
#ekran-baslik .gunluk-kart[data-kilitli] { border-image-source: url(../art/menu/kucuk-9.png); }
#ekran-baslik .gunluk-kart[data-kilitli] .gk-eylem { color: var(--m-t3); }
#ekran-baslik .gunluk-kart[data-kilitli] .px-ikon { opacity: .55; }
#ekran-baslik .gunluk-kart:active { transform: translateY(2px); box-shadow: none; }
#ekran-baslik .menu-dugme { padding: 4px 2px; color: var(--metin); background: none; border: 6px solid transparent; border-radius: 0; box-shadow: none;
  border-image: url(../art/menu/kucuk-9.png) 3 fill / 6px / 0 stretch; image-rendering: pixelated; filter: drop-shadow(0 3px 0 var(--m-k1)); }
#ekran-baslik .menu-dugme .px-ikon { width: 32px; height: 32px; }
#ekran-baslik .menu-dugme:active { box-shadow: none; }
#ekran-baslik .menu-dugme span { white-space: nowrap; overflow-wrap: normal; }
#ekran-baslik .md-durum { top: 0; right: 2px; color: var(--m-g3); }
@media (orientation: landscape) and (max-height: 500px) {
  #ekran-baslik .logo-sahne { --lp: 1px; }
  #ekran-baslik .logo-en { width: 165px; }
  #ekran-baslik .dugme.buyuk { min-height: 52px; font-size: 1.2rem; }
}
@media (max-height: 800px) { #ekran-baslik .sahne-on { bottom: -15px; } }   /* kısa ekranda üst kasa menü satırına değmesin */
@media (min-width: 600px) and (min-height: 900px) {
  #ekran-baslik .sahne-arka { background-size: 720px 1380px; }
  #ekran-baslik .sahne-on { height: 440px; }
  #ekran-baslik .sahne-on::before, #ekran-baslik .sahne-on::after { background-size: 480px 440px; }
}
@media (prefers-reduced-motion: reduce) {
  #ekran-baslik .sahne-arka, #ekran-baslik .sahne-on, #ekran-baslik .logo { animation: none; }
  #ekran-baslik .tozlar { display: none; }
  #ekran-baslik .lg-isci.bekle { animation: none; }   /* menu-anim.js açılışı oynatmaz: harf yerinde, işçi son karede */
  #ekran-baslik .lg-par { visibility: hidden; }
}

/* PD-DIL-1: JA/KO glifleri için sistem yedek fontu (piksel/monospace fontta yok) */
html[lang="ja"], html[lang="ja"] body { font-family: var(--font), "Noto Sans JP", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif; }
html[lang="ko"], html[lang="ko"] body { font-family: var(--font), "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; }
html[lang="ja"] button, html[lang="ja"] input, html[lang="ja"] select { font-family: inherit; }
html[lang="ko"] button, html[lang="ko"] input, html[lang="ko"] select { font-family: inherit; }

/* PD-WEB-MASAUSTU-1 (Furkan 29.10): masaüstü tarayıcı (ince işaretçi + hover, dokunma yok; main.js <html data-cihaz>).
   Oyun ortada bir çerçevede: yükseklik viewport'un %85'i, genişlik ≤ 4:3; ekranlar, paneller ve modallar çerçevenin
   içinde (contain: paint → fixed çocuklar da çerçeveye göre). Ekran D-pad'i yok; tahta tamsayı piksel ölçekte
   (masaustu.js masaustuYerlesimi). Dokunmatik (telefon/tablet/Capacitor) düzen hiç değişmez. */
.nasil-klavye, .klavye-ipucu { display: none; }
html[data-cihaz="masaustu"] { --cer-h: 85vh; --cer-w: min(calc(100vw - 32px), calc(var(--cer-h) * 4 / 3)); }
html[data-cihaz="masaustu"] body { background: #0e0c14; }
html[data-cihaz="masaustu"] #uygulama { inset: auto; top: calc((100vh - var(--cer-h)) / 2); left: 50%; margin-left: calc(var(--cer-w) / -2);
  width: var(--cer-w); height: var(--cer-h); padding: 0; contain: paint; overflow: hidden; background: var(--arka);
  border: 3px solid var(--panel); border-radius: 4px; box-shadow: 0 0 0 1px #000, 0 10px 0 #0006; }
html[data-cihaz="masaustu"] .kontrol { display: none; }
html[data-cihaz="masaustu"] #ekran-baslik .nasil:not(.nasil-klavye) { display: none; }
html[data-cihaz="masaustu"] #ekran-baslik .nasil-klavye { display: block; max-width: 44ch; }
html[data-cihaz="masaustu"] .klavye-ipucu { display: flex; flex-direction: column; gap: 2px; margin: 8px 0 0; padding: 6px 8px; font-size: .74rem; line-height: 1.3;
  color: var(--soluk); background: var(--panel); border-radius: 6px; }
html[data-cihaz="masaustu"] .tamekran-dugme { position: fixed; z-index: 20; right: calc(50vw - var(--cer-w) / 2); bottom: max(4px, calc((100vh - var(--cer-h)) / 2 - 42px));
  min-width: 0; min-height: 34px; padding: 4px 10px; display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--soluk); }
html[data-cihaz="masaustu"] .tamekran-dugme svg { image-rendering: pixelated; }
html[data-cihaz="masaustu"] .dugme:hover:not(:disabled), html[data-cihaz="masaustu"] .seviye:hover:not(:disabled) { filter: brightness(1.12); }
/* HUD sütunu masaüstünde büyük (patron 29.10: 1x okunmuyordu): yazı ≥14 px, sütun çerçeve genişliğinin ~%24'ü */
html[data-cihaz="masaustu"] { --hud-w: clamp(240px, calc(var(--cer-w) * .24), 320px); }
html[data-cihaz="masaustu"] .hud { gap: 8px; font-size: 16px; overflow-y: auto; }
html[data-cihaz="masaustu"] .istatistik { gap: 8px; }
html[data-cihaz="masaustu"] .istatistik div { padding: 6px; }
html[data-cihaz="masaustu"] .istatistik span { font-size: .875rem; }
html[data-cihaz="masaustu"] .istatistik b { font-size: 1.6rem; line-height: 1.15; }
html[data-cihaz="masaustu"] .ses-dugme svg { width: 32px; height: 32px; }
html[data-cihaz="masaustu"] .hud-hedef, html[data-cihaz="masaustu"] #hud-hedef { font-size: 1rem; }
html[data-cihaz="masaustu"] .hud .atla-dugme, html[data-cihaz="masaustu"] .hud .cozum-dugme { font-size: .875rem; min-height: 40px; }
html[data-cihaz="masaustu"] .hud-dugmeler .dugme, html[data-cihaz="masaustu"] .hud-dugmeler #dugme-ipucu[data-karar] { font-size: 1.1rem; min-height: 56px; }
html[data-cihaz="masaustu"] .klavye-ipucu { font-size: .875rem; line-height: 1.35; padding: 8px 10px; }
html[data-cihaz="masaustu"] .klavye-ipucu span { white-space: nowrap; }
@media (max-height: 820px) {
  html[data-cihaz="masaustu"] .hud { gap: 6px; }
  html[data-cihaz="masaustu"] .istatistik b { font-size: 1.3rem; }
  html[data-cihaz="masaustu"] .hud-dugmeler .dugme, html[data-cihaz="masaustu"] .hud-dugmeler #dugme-ipucu[data-karar] { min-height: 46px; padding: 4px; }
  /* PD-TASARIM-3: iki eşit sütunda "Oklar/WASD yürü" ikiye kırılıyordu → satır içi akış, öğe kendi içinde kırılmaz */
  html[data-cihaz="masaustu"] .klavye-ipucu { display: flex; flex-direction: row; flex-wrap: wrap; gap: 2px 12px; line-height: 1.25; }
}
@media (orientation: landscape) {
  html[data-cihaz="masaustu"] #ekran-oyun { grid-template-rows: minmax(0, 1fr); grid-template-columns: var(--hud-w) minmax(0, 1fr); grid-template-areas: "hud tahta"; }
  html[data-cihaz="masaustu"] .hud { max-width: none; margin: 0; padding: 12px 8px 12px 12px; }
}

/* ISTEK 158 (Furkan 29.10, CrazyGames ~745x560 iframe): ana menü kısa yükseklikte sığar. Ölçü viewport değil oyun
   ÇERÇEVESİ (#uygulama): masaüstünde çerçeve viewport'un %85'i (560 → 476 px), dokunmatikte viewport'un kendisi; bu
   yüzden @container (yükseklik) kullanılır. Kademeler: ≤700 nasıl metni gizli + sık aralık; ≤560 logo 1x (--lp 1px),
   düğmeler ≥44 px, Devam tek satır, ikonlar 24 px; ≤430 (yatay telefon) en sık. Yine sığmazsa ekran kaydırılır (overflow-y),
   içerik üstten başlar (safe center: üst kesilmez). #uygulama #ekran-baslik öneki: masaüstü/inline kurallarını yener. */
#uygulama { container: uygulama / size; }
#ekran-baslik { justify-content: safe center; overflow-y: auto; overscroll-behavior: contain; }
@container uygulama (max-height: 700px) {
  #uygulama #ekran-baslik { gap: 8px; padding: 10px 16px; }
  #uygulama #ekran-baslik .nasil { display: none; }
  #uygulama #ekran-baslik .alt { margin: 0; }
}
@container uygulama (max-height: 560px) {
  #uygulama #ekran-baslik { gap: 6px; padding: 8px 16px; }
  #uygulama #ekran-baslik .logo-sahne { --lp: 1px; margin: 0; }
  #uygulama #ekran-baslik .logo-tr { width: 178px; }
  #uygulama #ekran-baslik .logo-en { width: 165px; }
  #uygulama #ekran-baslik .alt { font-size: .85rem; line-height: 1.2; }
  #uygulama #ekran-baslik .baslik-sayac { padding: 0 10px; font-size: .85rem; }
  #uygulama #ekran-baslik .dugme.buyuk { min-height: 48px; min-width: 240px; padding: 2px 30px 5px; font-size: 1.25rem; }
  #uygulama #ekran-baslik .dugme.buyuk.devam { flex-direction: row; justify-content: center; align-items: baseline; gap: 10px; font-size: 1.1rem; }
  #uygulama #ekran-baslik .dugme.buyuk.devam small { font-size: .8rem; }
  #uygulama #ekran-baslik .gunluk-kart { min-height: 46px; padding: 0 10px; gap: 10px; line-height: 1.15; }
  #uygulama #ekran-baslik .gunluk-kart .px-ikon { width: 24px; height: 24px; }
  #uygulama #ekran-baslik .gunluk-kart, #uygulama #ekran-baslik .menu-satir { width: min(480px, 100%); }
  #uygulama #ekran-baslik .menu-dugme { flex-direction: row; gap: 6px; min-height: 46px; padding: 2px 4px; font-size: .78rem; }
  #uygulama #ekran-baslik .menu-dugme .px-ikon { width: 24px; height: 24px; }
}
@container uygulama (max-height: 430px) {
  #uygulama #ekran-baslik { gap: 5px; padding: 6px 16px; }
  #uygulama #ekran-baslik .alt { font-size: .78rem; }
  #uygulama #ekran-baslik .dugme.buyuk { min-height: 44px; }
  #uygulama #ekran-baslik .gunluk-kart, #uygulama #ekran-baslik .menu-dugme { min-height: 44px; }
}
/* ISTEK 158: kısa çerçevede Ayarlar listesi sıkı (yine sığmazsa ekran zaten kaydırılır; Başarımlar ve Seviye ızgarası
   kendi içinde kayar) */
@container uygulama (max-height: 560px) {
  #uygulama #ekran-ayarlar { padding-top: 8px; }
  #uygulama #ekran-ayarlar .ust, #uygulama #ekran-basarimlar .ust, #uygulama #ekran-secim .ust { margin-bottom: 8px; }
  #uygulama .ayar-liste { gap: 6px; }
  #uygulama .ayar-satir { min-height: 44px; padding: 4px 10px; }
}

/* Achievements/uzun etiket tek satır (dar ekran): @container kurallarından sonra gelmeli */
@media (max-width: 400px) { #uygulama #ekran-baslik .menu-satir { gap: 4px; } #uygulama #ekran-baslik .menu-dugme { flex-direction: column; gap: 1px; min-height: 58px; padding: 2px 0; font-size: .68rem; } #uygulama #ekran-baslik .menu-dugme .px-ikon { width: 22px; height: 22px; } }

/* PD-KENAR-1 (10.11; TD-KENAR-1 testçi bildirimi): dokunmatikte oyun ekranı hedefleri Android kenar geri hareketi
   şeridinden (≈24 dp) içeride — fiziksel kenara uzaklık ≥ 32 px (#uygulama güvenli alan dolgusu + buradaki dolgu).
   Yatayda HUD ve D-pad sütunları eklenen pay kadar genişler (düğme metni sığar, D-pad tahtaya binmez; tahta alanı daralır). Android'de ayrıca
   src/kenar.js → KenarDislama şeritleri sistem hareketinden dışlanır. Masaüstü (data-cihaz=masaustu) düzeni değişmez. */
html:not([data-cihaz="masaustu"]) {
  --kenar-sol: max(12px, calc(32px - env(safe-area-inset-left, 0px)));
  --kenar-sag: max(12px, calc(32px - env(safe-area-inset-right, 0px)));
}
@media (orientation: portrait) {
  html:not([data-cihaz="masaustu"]) .hud { padding-left: var(--kenar-sol); padding-right: var(--kenar-sag); }
}
@media (orientation: landscape) {
  html:not([data-cihaz="masaustu"]) #ekran-oyun { grid-template-columns: calc(140px + var(--kenar-sol)) minmax(0, 1fr) calc(176px + var(--kenar-sag)); }
  html:not([data-cihaz="masaustu"]) .hud { padding-left: var(--kenar-sol); }
  html:not([data-cihaz="masaustu"]) .kontrol { padding-left: 0; padding-right: var(--kenar-sag); }
}
/* tablet (kısa kenar ≥ 700 px): dikeyde HUD ortada ≤ 760 px, kenar payı margin + 16 px ≥ 32 px; yatayda D-pad 84 px ızgara */
@media (min-width: 700px) and (min-height: 700px) and (orientation: portrait) {
  html:not([data-cihaz="masaustu"]) .hud { padding-left: 16px; padding-right: 16px; max-width: min(760px, calc(100% - 32px)); }
}
@media (min-width: 700px) and (min-height: 700px) and (orientation: landscape) {
  html:not([data-cihaz="masaustu"]) #ekran-oyun { grid-template-columns: 220px minmax(0, 1fr) calc(280px + var(--kenar-sag)); }
  html:not([data-cihaz="masaustu"]) .kontrol { padding: 16px var(--kenar-sag) 16px 16px; }
}

/* PD-KONTROL-YUKARI-1 (11.11, testçi 1080x2392): uzun dikey telefonda (en-boy <= 9:19; 16:9 = .5625 ve 18:9 = .5 DEĞİŞMEZ,
   360x800/393x873/412x915 = .45 girer) D-pad kabının alt boşluğu ekran yüksekliğiyle orantılı: clamp(10px, 6vh, 64px) + güvenli alan.
   Kaydırma kipinde .kontrol gizli (display:none), yatay ve tablet kuralları bu bloğa girmez. */
@media (orientation: portrait) and (max-width: 699px) and (max-aspect-ratio: 9/19) {
  html:not([data-cihaz="masaustu"]) .kontrol { padding-bottom: calc(clamp(10px, 6vh, 64px) + env(safe-area-inset-bottom, 0px)); }
  html:not([data-cihaz="masaustu"]) .kontrol { padding-bottom: calc(clamp(10px, 6dvh, 64px) + env(safe-area-inset-bottom, 0px)); }
}

/* PD-TD-SURUM-1 (10.11): kısa yatay telefonda (yükseklik ≤ 500 px; 640/740/800x360, 844x390, 915x412) sol HUD sütunu
   tek sütunda 4 düğme + Atla + hedef satırıyla ekranın altından taşıyordu (İpucu 360 px'te görünmüyordu). Düğmeler
   2x2 ızgaraya geçer, ikon üstte / etiket altta (dikeydeki dar HUD gibi). Kanıt: araclar/pd-yatay-dugme-kanit.mjs. */
@media (orientation: landscape) and (max-height: 500px) {
  html:not([data-cihaz="masaustu"]) .hud { gap: 4px; padding-top: 6px; padding-bottom: 6px; }
  html:not([data-cihaz="masaustu"]) .hud .hud-dugmeler { grid-template-columns: 1fr 1fr; gap: 4px; }
  html:not([data-cihaz="masaustu"]) .hud-dugmeler .dugme.ikon { flex-direction: column; gap: 0; padding: 2px; font-size: .68rem; line-height: 1.1; min-height: 52px; min-width: 0; }
  html:not([data-cihaz="masaustu"]) .hud-dugmeler #dugme-ipucu:not([data-karar="ucretsiz"]):not([data-karar="premium"]) { font-size: .6rem; }
}

/* PD-DUZELT-1: Oyna (sıradaki seviye) + yanında kare "Seviyeler" düğmesi; kare Oyna'nın yüksekliğini alır (stretch + 1:1) */
#ekran-baslik .oyna-satir { display: flex; align-items: stretch; justify-content: center; gap: 20px; max-width: 100%; } /* gap: Oyna rozeti (sağ -14px) kareye değmesin */
#ekran-baslik .seviyeler-dugme { flex: none; align-self: stretch; aspect-ratio: 1 / 1; width: auto; min-width: 44px; min-height: 44px; padding: 0;
  display: flex; align-items: center; justify-content: center; background: none; border: 6px solid transparent; border-radius: 0; box-shadow: none;
  border-image: url(../art/menu/kucuk-9.png) 3 fill / 6px / 0 stretch; image-rendering: pixelated; filter: drop-shadow(0 3px 0 var(--m-k1)); }
#ekran-baslik .seviyeler-dugme .px-ikon { width: 32px; height: 32px; }
#ekran-baslik .seviyeler-dugme:active { transform: translateY(2px); filter: none; box-shadow: none; }

/* PD-KONTROL-1 (Furkan 16.11): kontrol düzeni kartları (ilk açılış seçimi + Ayarlar) — şema + ad + kısa açıklama, tek dokunuş */
.duzen-secenekler { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; width: 100%; }
.duzen-secenek { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; min-width: 0; min-height: 48px;
  padding: 8px 4px; font: inherit; color: var(--metin); background: var(--arka); border: 2px solid var(--soluk); border-radius: 8px; cursor: pointer;
  touch-action: manipulation; text-align: center; }
.duzen-secenek:active { transform: translateY(1px); }
.duzen-secenek[aria-checked="true"] { border-color: var(--vurgu); box-shadow: 0 0 0 1px var(--vurgu), inset 0 0 10px #ffcd7533; }
.duzen-secenek b { font-size: .85rem; line-height: 1.15; overflow-wrap: anywhere; }
.duzen-secenek small { font-size: .7rem; line-height: 1.2; color: var(--soluk); overflow-wrap: anywhere; }
/* PD-106: Korecede kelime (어절) hece ortasından bölünmesin; sığmayan tek kelimede yine anywhere devreye girer */
.duzen-secenek:lang(ko) :is(b, small) { word-break: keep-all; }
.duzen-sema { width: 42px; height: 70px; flex: none; color: var(--soluk); }
.duzen-sema .oz-govde { fill: #1a1424; stroke: currentColor; stroke-width: 1; }
.duzen-sema .oz-bilgi { fill: #5d5663; }
.duzen-sema .oz-tahta { fill: #6b4f6b; }
.duzen-sema .oz-dugme, .duzen-sema .oz-tus { fill: var(--metin); }
.duzen-sema .oz-ok { fill: var(--vurgu); }
.duzen-secenek[aria-checked="true"] .duzen-sema { color: var(--vurgu); }
.duzen-perde { z-index: 6; overflow-y: auto; }
.duzen-kart { width: min(520px, 100%); min-width: 0; padding: 16px 12px; }
.duzen-kart h2 { margin: 0 0 12px; font-size: 1.15rem; }
.duzen-not { margin: 12px 0 0; font-size: .82rem; color: var(--soluk); }
.ayar-duzen-satir { flex-direction: column; align-items: stretch; gap: 6px; padding-top: 8px; padding-bottom: 8px; }

/* PD-KONTROL-1 düzen B "tek el" (dokunmatik): .hud çözülür (display: contents); üstte yalnız bilgi (sayaçlar + hedef satırı),
   geri al / baştan / geri / ipucu 2x2 ızgara olarak D-pad'in solunda, ekranın altında (başparmak bölgesi). Tahta kalan alana
   ölçeklenir (üst düğme satırı kalktığı için A'dan büyük). Yatayda: sol sütun bilgi, sağ sütun düğmeler + D-pad. */
html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] .hud { display: contents; }
html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] .istatistik { grid-area: ist; }
html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] .hud-hedef-satir { grid-area: hedef; }
html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] .hud-dugmeler { grid-area: dugme; grid-template-columns: 1fr 1fr; gap: 6px; align-self: end; align-content: end; }
html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] .klavye-ipucu { display: none; }
html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] .hud-dugmeler .dugme.ikon { flex-direction: column; gap: 0; padding: 2px; font-size: .68rem; line-height: 1.1; min-height: 52px; min-width: 0; white-space: nowrap; }
html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] .hud-dugmeler #dugme-ipucu:not([data-karar="ucretsiz"]):not([data-karar="premium"]) { font-size: .6rem; }
/* ses düğmesi her düzende ≥ 48 px dokunma hedefi (önce 44 px yüksekti) */
html:not([data-cihaz="masaustu"]) #ekran-oyun .ses-dugme { min-height: 48px; }

/* PD-KONTROL-2 (Furkan 16.11, karelere bakarak): B dikey — eylem düğmeleri ile D-pad arasında ≥ 24 px boş sütun (yanlış basma
   olmasın); "Baştan" D-pad'e en uzak köşede (sol üst), "Geri al" en yakında; "Atla" da altta (2 sütun genişliğinde, 3. satır);
   etiketler tek satır. Üstte sayaçlar + ses + hedef metni. Hücreler ızgara satır/sütunuyla (.hud, hedef satırı, düğme ızgarası çözülür). */
@media (orientation: portrait) {
  html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] {
    grid-template-columns: var(--kenar-sol) minmax(0, 1fr) minmax(0, 1fr) calc(28px * var(--oy, 1)) auto var(--kenar-sag); /* PD-107: 24 → 28 px nefes (360 px'te düğmeler 48 px kalsın) */
    grid-template-rows: auto auto minmax(0, 1fr) auto auto auto var(--tekel-alt, 10px);
    grid-template-areas: none; column-gap: 0; row-gap: 4px; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] .hud-hedef-satir, html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] .hud-dugmeler { display: contents; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] .istatistik { grid-column: 1 / -1; grid-row: 1; padding: 8px var(--kenar-sag) 0 var(--kenar-sol); }
  html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] #hud-hedef { grid-column: 2 / 6; grid-row: 2; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* PD-HEDEF-YERI-1: tek satır */
  html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] .tahta-alan { grid-column: 1 / -1; grid-row: 3; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] #dugme-yeniden { grid-column: 2; grid-row: 4; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] #dugme-ipucu { grid-column: 3; grid-row: 4; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] #dugme-geri { grid-column: 2; grid-row: 5; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] #dugme-geriAl { grid-column: 3; grid-row: 5; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] .hud-dugmeler .dugme { margin: 0 2px; min-height: calc(48px * var(--oy, 1)); }
  /* PD-109: Menü (Geri) ile Geri al arası 4 → 8 px (yanlış dokunuş); dış kenarlar Atla ile hizalı kalır */
  html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] :is(#dugme-yeniden, #dugme-geri) { margin: 0 4px 0 2px; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] :is(#dugme-ipucu, #dugme-geriAl) { margin: 0 2px 0 4px; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] .hud-dugmeler .dugme.ikon { min-height: calc(48px * var(--oy, 1)); font-size: .62rem; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] #dugme-atla, html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] #dugme-cozum { grid-column: 2 / 4; grid-row: 6; margin: 0 2px; width: auto; min-height: calc(48px * var(--oy, 1)); justify-content: center; white-space: nowrap; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] .kontrol { grid-column: 5; grid-row: 4 / 7; padding: 0; align-items: center; justify-content: center; }
  /* dar sütunda (~56 px) İpucu: simge + kalan hak sayısı (tam metin aria-label'da); reklam / bekleme durumları küçük yazıyla */
  html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] #dugme-ipucu:is([data-karar="ucretsiz"], [data-karar="premium"]) { font-size: 0; gap: 0; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] #dugme-ipucu:is([data-karar="ucretsiz"], [data-karar="premium"])::after { content: attr(data-kalan); font-size: .75rem; line-height: 1.1; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] #dugme-ipucu:not([data-karar="ucretsiz"]):not([data-karar="premium"]) { white-space: normal; overflow-wrap: anywhere; font-size: .55rem; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] #dugme-atla { padding: 2px 4px; gap: 4px; font-size: .64rem; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] .dpad { grid-template-columns: repeat(3, calc(var(--dp, 48px) * var(--oy, 1))); grid-template-rows: repeat(3, calc(var(--dp, 48px) * var(--oy, 1))); gap: calc(4px * var(--oy, 1)); }
}
/* PD-KONTROL-2/3: A dikey telefon — tahta genişliği doldurur (360x640: 288 → 360 px). Üstte sayaçlar + eylem sırası; "Atla" bu
   sıranın 5. düğmesi (PD-KONTROL-3: D-pad yanında yanlış basılıyordu; gizliyken sütun kapanır). Altta yalnız D-pad (48 px hücre)
   ve solunda "Hedef" yazısı (dokunma hedefi değil). */
@media (orientation: portrait) and (max-width: 699px) {
  html:not([data-cihaz="masaustu"]) #ekran-oyun:is([data-kontrol="ikisi"], [data-kontrol="dpad"]) {
    grid-template-columns: var(--kenar-sol) minmax(0, 1fr) auto var(--kenar-sag);
    grid-template-rows: auto auto auto minmax(0, 1fr) auto var(--a-alt, 6px);
    grid-template-areas: none; column-gap: 0; row-gap: 4px; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun:is([data-kontrol="ikisi"], [data-kontrol="dpad"]) .hud, html:not([data-cihaz="masaustu"]) #ekran-oyun:is([data-kontrol="ikisi"], [data-kontrol="dpad"]) .hud-hedef-satir { display: contents; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun:is([data-kontrol="ikisi"], [data-kontrol="dpad"]) .klavye-ipucu { display: none; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun:is([data-kontrol="ikisi"], [data-kontrol="dpad"]) .istatistik { grid-column: 2 / 4; grid-row: 1; padding-top: 6px; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun:is([data-kontrol="ikisi"], [data-kontrol="dpad"]) .istatistik div { line-height: 1.2; padding: 4px 2px; } /* JA "ステージ" dar kutuda 2 satıra inip tahtayı küçültmesin */
  html:not([data-cihaz="masaustu"]) #ekran-oyun:is([data-kontrol="ikisi"], [data-kontrol="dpad"]) .hud-dugmeler { grid-column: 2; grid-row: 2; gap: 4px; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun:is([data-kontrol="ikisi"], [data-kontrol="dpad"]) .hud-dugmeler .dugme.ikon { min-height: 48px; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun:is([data-kontrol="ikisi"], [data-kontrol="dpad"]) .tahta-alan { grid-column: 1 / -1; grid-row: 4; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun:is([data-kontrol="ikisi"], [data-kontrol="dpad"]) .kontrol { grid-column: 2 / 4; grid-row: 5; justify-self: center; padding: 0; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun:is([data-kontrol="ikisi"], [data-kontrol="dpad"]) .dpad { grid-template-columns: repeat(3, var(--dp, 48px)); grid-template-rows: repeat(3, var(--dp, 48px)); gap: 4px; }
  /* PD-HEDEF-YERI-1 (Furkan 18.11: D-pad'in dibinde iyi durmuyordu): hedef satırı üst bilgi alanında, düğme sırasının altında, tahtanın
     üstünde, ortalı tek satır (sığmazsa main.js hedefSigdir puntoyu ≥ 12 px'e kadar küçültür, sonra üç nokta). D-pad satırı yalnız D-pad. */
  html:not([data-cihaz="masaustu"]) #ekran-oyun:is([data-kontrol="ikisi"], [data-kontrol="dpad"]) #hud-hedef { grid-column: 2 / 4; grid-row: 3; justify-self: center; align-self: center; max-width: 100%; margin: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .92rem; line-height: 1.2; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun:is([data-kontrol="ikisi"], [data-kontrol="dpad"]) #dugme-atla, html:not([data-cihaz="masaustu"]) #ekran-oyun:is([data-kontrol="ikisi"], [data-kontrol="dpad"]) #dugme-cozum { grid-column: 3; grid-row: 2; align-self: stretch; width: 56px; min-width: 56px; margin-left: 4px; padding: 2px;
    flex-direction: column; justify-content: center; gap: 4px; white-space: normal; overflow-wrap: normal; text-align: center; font-size: .55rem; line-height: 1.1; min-height: 48px; }
  /* PD-106: kelime ortasından kırma yok ('Пропустит / ь'); etiket kısa ad (atlaKisa), uzun durum yazısı yalnız boşlukta kırılır */
}
/* PD-KONTROL-3: dar dikeyde (≤ 420 px) 5'li sırada düğme ~56 px: etiket küçük + tek satır; İpucu simge + kalan sayı (tek eldeki gibi) */
@media (orientation: portrait) and (max-width: 420px) {
  html:not([data-cihaz="masaustu"]) #ekran-oyun:is([data-kontrol="ikisi"], [data-kontrol="dpad"]) .hud-dugmeler .dugme.ikon { font-size: .55rem; letter-spacing: -.02em; white-space: nowrap; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun:is([data-kontrol="ikisi"], [data-kontrol="dpad"]) #dugme-ipucu:is([data-karar="ucretsiz"], [data-karar="premium"]) { font-size: 0; gap: 0; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun:is([data-kontrol="ikisi"], [data-kontrol="dpad"]) #dugme-ipucu:is([data-karar="ucretsiz"], [data-karar="premium"])::after { content: attr(data-kalan); font-size: .68rem; line-height: 1.1; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun:is([data-kontrol="ikisi"], [data-kontrol="dpad"]) .hud-dugmeler #dugme-ipucu:not([data-karar="ucretsiz"]):not([data-karar="premium"]) { white-space: normal; overflow-wrap: anywhere; font-size: .5rem; }
}
@media (orientation: portrait) and (max-width: 699px) and (max-aspect-ratio: 9/19) {
  html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] { --tekel-alt: calc(clamp(10px, 6vh, 64px) + env(safe-area-inset-bottom, 0px)); }
  html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] { --tekel-alt: calc(clamp(10px, 6dvh, 64px) + env(safe-area-inset-bottom, 0px)); }
  html:not([data-cihaz="masaustu"]) #ekran-oyun:is([data-kontrol="ikisi"], [data-kontrol="dpad"]) { --a-alt: calc(clamp(10px, 6vh, 64px) + env(safe-area-inset-bottom, 0px)); }
  html:not([data-cihaz="masaustu"]) #ekran-oyun:is([data-kontrol="ikisi"], [data-kontrol="dpad"]) { --a-alt: calc(clamp(10px, 6dvh, 64px) + env(safe-area-inset-bottom, 0px)); }
}
@media (orientation: landscape) {
  html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] {
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "ist tahta dugme" "hedef tahta kontrol"; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] .istatistik { grid-template-columns: 1fr 1fr; padding: 8px 6px 4px var(--kenar-sol); }
  html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] .hud-hedef-satir { padding: 0 6px 0 var(--kenar-sol); }
  html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] .hud-dugmeler { padding: 8px var(--kenar-sag) 0 4px; gap: 4px 8px; align-self: start; } /* PD-109: sütun arası 8 px */
  html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] .hud-hedef-satir { align-self: start; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] .kontrol { padding-top: calc(24px * var(--oy, 1)); }
  html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] .dpad { grid-template-columns: repeat(3, calc(var(--dp, 48px) * var(--oy, 1))); grid-template-rows: repeat(3, calc(var(--dp, 48px) * var(--oy, 1))); gap: calc(4px * var(--oy, 1)); } /* sağa yaslı: Baştan (sol üst) D-pad'e en uzak */
  html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] #dugme-yeniden { order: 1; } html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] #dugme-ipucu { order: 2; } html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] #dugme-geri { order: 3; } html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] #dugme-geriAl { order: 4; }
}

/* PD-HEDEF-YERI-1: kaydırma düzeninde (D-pad yok) dikey telefonda hedef satırı da tek satır; sığmazsa main.js hedefSigdir küçültür. */
@media (orientation: portrait) {
  html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="kaydirma"] #hud-hedef { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
}
/* PD-HEDEF-YERI-1: kısa dikey telefonda (≤ 700 px, ör. 360x640) hedef satırı tahtadan yer çalmasın: satır aralıkları 4 → 0
   (D-pad'in üstünde 4 px pay kalır), hedef 12 px / 1,15 satır, sayaç üst payı 6 → 4 px. 360x640'ta tahta 360 px kalır (önce 360). */
@media (orientation: portrait) and (max-width: 699px) and (max-height: 700px) {
  html:not([data-cihaz="masaustu"]) #ekran-oyun:is([data-kontrol="ikisi"], [data-kontrol="dpad"]) { row-gap: 0; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun:is([data-kontrol="ikisi"], [data-kontrol="dpad"]) .istatistik { padding-top: 4px; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun:is([data-kontrol="ikisi"], [data-kontrol="dpad"]) .kontrol { margin-top: 4px; }
  html:not([data-cihaz="masaustu"]) #ekran-oyun:is([data-kontrol="ikisi"], [data-kontrol="dpad"]) #hud-hedef { font-size: .75rem; line-height: 1.15; }
}

/* PD-107 (Furkan telefonda): Geri yazısı küçük, Atla biraz küçük, seviye yerindeki "Günlük" fazla büyük. Kimlik seçicisiyle
   düzen kurallarının (tek el / iki / kaydırma) üstüne yazar; masaüstüne dokunmaz (tablette rem --o ile ölçeklenir). */
html:not([data-cihaz="masaustu"]) #ekran-oyun #dugme-geri.dugme.ikon { font-size: .75rem; font-weight: bold; }
html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] #dugme-geriAl.dugme.ikon:lang(de) { white-space: normal; hyphens: manual; } /* PD-109: yalnız DE "Rückgängig" dar düğmede yumuşak tireden iki satır (öbür diller tek satır) */
html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] #dugme-geri.dugme.ikon { font-size: .7rem; } /* tek elde 48 px düğme: 9,9 → 11,2 px (id "Kembali" sığsın) */
html:not([data-cihaz="masaustu"]) #ekran-oyun:is([data-kontrol="ikisi"], [data-kontrol="dpad"]) #dugme-atla.dugme { font-size: .75rem; letter-spacing: -.02em; } /* PD-108: 9,9 → 12 px (de "Auslassen" sığsın diye düğme 64 → 72 px, aşağıda) */
html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="tekel"] #dugme-atla.dugme { font-size: .75rem; } /* PD-108: 11,2 → 12 px */
html:not([data-cihaz="masaustu"]) #ekran-oyun[data-kontrol="kaydirma"] #dugme-atla.dugme { min-height: 48px; } /* yazı 12,8 px kalır; boy 36 → 48 */
@media (orientation: portrait) and (max-width: 699px) {
  html:not([data-cihaz="masaustu"]) #ekran-oyun:is([data-kontrol="ikisi"], [data-kontrol="dpad"]) #dugme-atla.dugme { width: 72px; min-width: 72px; } /* PD-108: 64 → 72 (12 px yazı) */
}
html:not([data-cihaz="masaustu"]) #ekran-oyun #hud-seviye[data-gunluk] { font-size: .78rem; line-height: 1.75; }

/* PD-107: günlük bulmaca hazırlanırken kart yavaşça nabız atar (düğmeye basıldığı hemen görünsün) */
@keyframes gunluk-nabiz { 50% { opacity: .55; } }
#gunluk-kart[data-mesgul] { animation: gunluk-nabiz .8s steps(4) infinite; cursor: progress; }

/* PD-TABLET-1 (11.11, testçi tablette "küçük kalmış"): geniş dokunmatik ekranda (kısa kenar ≥ 600 px, src/tablet.js
   ölçek ≥ 1,5) her ekran telefondakiyle aynı oranda büyür. <html data-tablet> + --o (0,5 adımlı; 600 px → 1,5, 800 → 2,
   1200 → 3), --o-tam (1x çizilen sanat için tam sayı), --o-on (ön kasalar, telefonda 3x). Yazı: kök font --o ile büyür,
   rem değerleri kendiliğinden ölçeklenir; px değerleri burada telefon değeri × --o. Piksel sanat telefonda 2x → burada
   2·o (tam sayı) kat. Eski "kısa kenar ≥ 700" tablet kuralları (index.html, PD-6c) burada telefon oranına geri çekilir.
   Telefonda (data-tablet yok) bu blok hiç uygulanmaz; masaüstü çerçevesi kendi düzeninde kalır (seçiciler PD-KENAR-1 gibi
   html:not([data-cihaz="masaustu"]) ile başlar; tablet.js masaüstünde data-tablet yazmaz). */
html:not([data-cihaz="masaustu"])[data-tablet] { font-size: calc(16px * var(--o)); --kenar-sol: calc(32px * var(--o)); --kenar-sag: calc(32px * var(--o)); }
/* genel düğme (özel kurallar aşağıda); :where ile özgüllük düşük kalır, ekran kuralları ezebilir */
html:not([data-cihaz="masaustu"])[data-tablet] :where(.dugme) { padding: calc(10px * var(--o)) calc(14px * var(--o)); min-height: calc(48px * var(--o)); min-width: calc(48px * var(--o));
  border-width: calc(2px * var(--o)); border-radius: calc(6px * var(--o)); box-shadow: 0 calc(3px * var(--o)) 0 #0008; }
html:not([data-cihaz="masaustu"])[data-tablet] :where(.dugme.kucuk) { padding: calc(6px * var(--o)) calc(12px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .dugme.geri-dugme::before { width: calc(20px * var(--o)); height: calc(20px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .ust .dugme.geri-dugme { gap: calc(6px * var(--o)); padding: calc(8px * var(--o)) calc(14px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .ikon::before, html:not([data-cihaz="masaustu"])[data-tablet] .seviye:disabled small { width: calc(32px * var(--o)); height: calc(32px * var(--o));
  background-size: calc(512px * var(--o)) calc(160px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .ikon { gap: calc(4px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] #dugme-geriAl::before { background-position: 0 calc(-128px * var(--oy)); }
html:not([data-cihaz="masaustu"])[data-tablet] #dugme-yeniden::before { background-position: calc(-32px * var(--oy)) calc(-128px * var(--oy)); }
html:not([data-cihaz="masaustu"])[data-tablet] #kart-tekrar::before { background-position: calc(-32px * var(--o)) calc(-128px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] #dugme-geri::before { background-position: calc(-64px * var(--oy)) calc(-128px * var(--oy)); }
html:not([data-cihaz="masaustu"])[data-tablet] #secim-geri::before, html:not([data-cihaz="masaustu"])[data-tablet] #kart-secim::before { background-position: calc(-64px * var(--o)) calc(-128px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] #dugme-ipucu::before { background-position: calc(-160px * var(--oy)) calc(-128px * var(--oy)); }
html:not([data-cihaz="masaustu"])[data-tablet] .seviye:disabled small { background-position: calc(-256px * var(--o)) calc(-128px * var(--o)); }

/* ana menü */
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik { gap: calc(10px * var(--o)); padding: calc(24px * var(--o)) calc(16px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .nasil { display: none; }   /* tablet oranı (16:10) telefonun kısa ekranı gibi: 360x740'ta da gizli */
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .alt { margin: 0 0 calc(4px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .sahne-arka { inset: 0 calc(-12px * var(--o)); background-size: calc(480px * var(--o)) calc(920px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .sahne-on { left: calc(-12px * var(--o)); right: calc(-12px * var(--o)); height: calc(110px * var(--o-on)); bottom: 0; }
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .sahne-on::before, html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .sahne-on::after { background-size: calc(120px * var(--o-on)) calc(110px * var(--o-on)); }
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .toz { width: calc(6px * var(--o)); height: calc(6px * var(--o)); background-size: calc(6px * var(--o)) calc(6px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .toz.k { width: calc(4px * var(--o)); height: calc(4px * var(--o)); background-size: calc(4px * var(--o)) calc(4px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .logo { margin: calc(4px * var(--o)) 0 calc(2px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .logo-sahne { --lp: calc(2px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .logo-tr { width: calc(356px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .logo-en { width: calc(330px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .baslik-sayac { gap: calc(6px * var(--o)); padding: calc(2px * var(--o)) calc(10px * var(--o));
  border-width: calc(6px * var(--o)); border-image-width: calc(6px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .baslik-sayac .px-ikon { width: calc(16px * var(--o-tam)); height: calc(16px * var(--o-tam)); }
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .dugme.buyuk { min-width: calc(200px * var(--o)); min-height: calc(60px * var(--o));
  padding: calc(4px * var(--o)) calc(34px * var(--o)) calc(8px * var(--o)); border-width: calc(6px * var(--o)); border-image-width: calc(6px * var(--o));
  text-shadow: 0 calc(2px * var(--o)) 0 var(--m-c3); filter: drop-shadow(0 calc(4px * var(--o)) 0 var(--m-k1)); }
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .dugme.buyuk::before, html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .dugme.buyuk::after { width: calc(6px * var(--o)); height: calc(6px * var(--o));
  margin-top: calc(-3px * var(--o)); box-shadow: 0 calc(2px * var(--o)) 0 var(--m-c3); }
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .dugme.buyuk::before { left: calc(6px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .dugme.buyuk::after { right: calc(6px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .dugme.buyuk:active { transform: translateY(calc(2px * var(--o))); filter: drop-shadow(0 calc(2px * var(--o)) 0 var(--m-k1)); }
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .oyna-rozet { top: calc(-16px * var(--o)); right: calc(-14px * var(--o)); min-width: calc(34px * var(--o)); padding: 0 calc(4px * var(--o));
  line-height: calc(22px * var(--o)); text-shadow: 0 calc(2px * var(--o)) 0 var(--m-k1); border-width: calc(6px * var(--o)); border-image-width: calc(6px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .oyna-rozet[data-tip="kupa"]::after { width: calc(16px * var(--o-tam)); height: calc(16px * var(--o-tam));
  background-size: calc(16px * var(--o-tam)) calc(16px * var(--o-tam)); vertical-align: calc(-3px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .gunluk-kart { width: min(calc(340px * var(--o)), 100%); min-height: calc(60px * var(--o)); gap: calc(10px * var(--o));
  padding: calc(4px * var(--o)) calc(8px * var(--o)); border-width: calc(6px * var(--o)); border-image-width: calc(6px * var(--o));
  filter: drop-shadow(0 calc(3px * var(--o)) 0 var(--m-k1)); }
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .gunluk-kart .px-ikon, html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .menu-dugme .px-ikon { width: calc(32px * var(--o)); height: calc(32px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .menu-satir { width: min(calc(340px * var(--o)), 100%); gap: calc(8px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .menu-dugme { min-height: calc(64px * var(--o)); gap: calc(2px * var(--o)); padding: calc(4px * var(--o)) calc(2px * var(--o)); font-size: .7rem;
  border-width: calc(6px * var(--o)); border-image-width: calc(6px * var(--o)); filter: drop-shadow(0 calc(3px * var(--o)) 0 var(--m-k1)); }
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .md-durum { right: calc(2px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .dugme.kucuk { min-height: calc(40px * var(--o)); }

/* seviye seçimi */
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-secim, html:not([data-cihaz="masaustu"])[data-tablet] #ekran-ayarlar, html:not([data-cihaz="masaustu"])[data-tablet] #ekran-basarimlar { padding: calc(12px * var(--o)) calc(16px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .ust { gap: calc(12px * var(--o)); margin-bottom: calc(12px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .paket-sekme { max-width: calc(560px * var(--o)); gap: calc(6px * var(--o)); margin-bottom: calc(8px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .paket-sekme button { min-height: calc(44px * var(--o)); padding: calc(2px * var(--o)) calc(4px * var(--o)); border-width: calc(2px * var(--o)); border-radius: calc(6px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .paket-sekme .tema-onizle { width: calc(48px * var(--o-tam)); height: calc(16px * var(--o-tam)); margin: calc(3px * var(--o)) 0 calc(1px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .paket-kilit { max-width: calc(560px * var(--o)); margin-bottom: calc(8px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .seviye-izgara { max-width: calc(560px * var(--o)); grid-template-columns: repeat(5, minmax(calc(48px * var(--o)), 1fr));
  grid-auto-rows: calc(64px * var(--o)); gap: calc(10px * var(--o)); padding: calc(2px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .seviye { min-height: calc(48px * var(--o)); gap: calc(2px * var(--o)); padding: calc(2px * var(--o)); border-radius: calc(8px * var(--o));
  border-width: calc(6px * var(--o)); border-image-width: calc(16px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .seviye .izlendi-isaret { top: calc(2px * var(--o)); right: calc(2px * var(--o)); width: calc(14px * var(--o)); height: calc(10px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .seviye .atlandi-isaret { width: calc(18px * var(--o)); height: calc(10px * var(--o)); }

/* oyun ekranı: HUD, hedef satırı, D-pad --oy ile ölçeklenir (tur 2, patron: "tahta tablette küçülemez"). --oy ≤ --o,
   main.js oyunOlcekAyarla seviye başına seçer (tablet.js oyunOlcekSec): denetimler tahtanın karosunu düşürmeyen en büyük
   0,5 adımlı ölçekte; yer yetmezse adım adım telefon boyuna (1) iner. Yazılar em: HUD kök fontu 16 px × --oy. */
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-oyun { --oy: var(--o); }
html:not([data-cihaz="masaustu"])[data-tablet] .hud, html:not([data-cihaz="masaustu"])[data-tablet] .kontrol { font-size: calc(16px * var(--oy)); }
html:not([data-cihaz="masaustu"])[data-tablet] .hud .ikon::before { width: calc(32px * var(--oy)); height: calc(32px * var(--oy)); background-size: calc(512px * var(--oy)) calc(160px * var(--oy)); }
html:not([data-cihaz="masaustu"])[data-tablet] .hud .ikon { gap: calc(4px * var(--oy)); }
html:not([data-cihaz="masaustu"])[data-tablet] .hud .dugme.geri-dugme::before { width: calc(20px * var(--oy)); height: calc(20px * var(--oy)); }
html:not([data-cihaz="masaustu"])[data-tablet] .hud .dugme.kucuk { font-size: .8em; }
html:not([data-cihaz="masaustu"])[data-tablet] .hud .dugme.cozum-dugme { font-size: .72em; }
html:not([data-cihaz="masaustu"])[data-tablet] .hud .dugme.atla-dugme { font-size: .75em; }
html:not([data-cihaz="masaustu"])[data-tablet] .hud #dugme-ipucu:not([data-karar="ucretsiz"]) { font-size: .78em; }
html:not([data-cihaz="masaustu"])[data-tablet] .hud #dugme-ipucu[data-karar="bekle"], html:not([data-cihaz="masaustu"])[data-tablet] .hud #dugme-ipucu[data-karar="simdilikYok"] { font-size: .58em; }
@media (orientation: portrait) {
  html:not([data-cihaz="masaustu"])[data-tablet] #ekran-oyun { --kenar-sol: calc(32px * var(--oy)); --kenar-sag: calc(32px * var(--oy)); }
  html:not([data-cihaz="masaustu"])[data-tablet] .hud #dugme-ipucu:not([data-karar="ucretsiz"]):not([data-karar="premium"]) { font-size: .6em; }
}
html:not([data-cihaz="masaustu"])[data-tablet] .hud { max-width: none; width: auto; margin: 0; gap: calc(6px * var(--oy));
  padding: calc(8px * var(--oy)) var(--kenar-sag) calc(4px * var(--oy)) var(--kenar-sol); }
html:not([data-cihaz="masaustu"])[data-tablet] .istatistik { gap: calc(6px * var(--oy)); grid-template-columns: repeat(4, 1fr) calc(48px * var(--oy)); }
html:not([data-cihaz="masaustu"])[data-tablet] .istatistik div { padding: calc(4px * var(--oy)) calc(6px * var(--oy)); border-radius: calc(6px * var(--oy)); }
html:not([data-cihaz="masaustu"])[data-tablet] .istatistik span { font-size: .68em; }
html:not([data-cihaz="masaustu"])[data-tablet] .istatistik b { font-size: 1.1em; }
html:not([data-cihaz="masaustu"])[data-tablet] .ses-dugme { padding: 0; min-height: calc(44px * var(--oy)); min-width: calc(44px * var(--oy)); }
html:not([data-cihaz="masaustu"])[data-tablet] .ses-dugme svg { width: calc(28px * var(--oy)); height: calc(28px * var(--oy)); }
html:not([data-cihaz="masaustu"])[data-tablet] .hud-dugmeler { gap: calc(6px * var(--oy)); }
html:not([data-cihaz="masaustu"])[data-tablet] .hud-dugmeler .dugme { padding: calc(6px * var(--oy)) calc(4px * var(--oy)); font-size: .9em; min-height: calc(48px * var(--oy)); }
html:not([data-cihaz="masaustu"])[data-tablet] .hud-hedef { font-size: .72em; margin-top: calc(2px * var(--oy)); }
html:not([data-cihaz="masaustu"])[data-tablet] .hud-hedef-satir { gap: calc(8px * var(--oy)); }
html:not([data-cihaz="masaustu"])[data-tablet] .cozum-dugme { min-height: calc(32px * var(--oy)); padding: calc(3px * var(--oy)) calc(10px * var(--oy)); }
html:not([data-cihaz="masaustu"])[data-tablet] .atla-dugme { min-height: calc(36px * var(--oy)); padding: calc(3px * var(--oy)) calc(10px * var(--oy)); gap: calc(6px * var(--oy)); }
html:not([data-cihaz="masaustu"])[data-tablet] .atla-ikon { width: calc(18px * var(--oy)); height: calc(10px * var(--oy)); }
html:not([data-cihaz="masaustu"])[data-tablet] .kontrol { padding: calc(4px * var(--oy)) calc(12px * var(--oy)) calc(10px * var(--oy)); }
html:not([data-cihaz="masaustu"])[data-tablet] .dpad { grid-template-columns: repeat(3, calc(56px * var(--oy))); grid-template-rows: repeat(3, calc(56px * var(--oy))); gap: calc(4px * var(--oy)); }
html:not([data-cihaz="masaustu"])[data-tablet] .dp { border-width: calc(2px * var(--oy)); border-radius: calc(10px * var(--oy)); }
html:not([data-cihaz="masaustu"])[data-tablet] .dp::after { border-width: calc(10px * var(--oy)); }
html:not([data-cihaz="masaustu"])[data-tablet] .dp-u::after { border-bottom-width: calc(14px * var(--oy)); border-top-width: 0; }
html:not([data-cihaz="masaustu"])[data-tablet] .dp-d::after { border-top-width: calc(14px * var(--oy)); border-bottom-width: 0; }
html:not([data-cihaz="masaustu"])[data-tablet] .dp-l::after { border-right-width: calc(14px * var(--oy)); border-left-width: 0; }
html:not([data-cihaz="masaustu"])[data-tablet] .dp-r::after { border-left-width: calc(14px * var(--oy)); border-right-width: 0; }
html:not([data-cihaz="masaustu"])[data-tablet] .ipucu-mesaj { top: calc(8px * var(--oy)); padding: calc(6px * var(--oy)) calc(10px * var(--oy)); border-width: calc(2px * var(--oy)); border-radius: calc(6px * var(--oy)); }
html:not([data-cihaz="masaustu"])[data-tablet] .izle-cubuk { left: calc(8px * var(--oy)); right: calc(8px * var(--oy)); bottom: calc(8px * var(--oy)); gap: calc(6px * var(--oy)); padding: calc(6px * var(--oy)) calc(8px * var(--oy)); border-width: calc(2px * var(--oy)); }
html:not([data-cihaz="masaustu"])[data-tablet] .izle-dugmeler .dugme { min-height: calc(44px * var(--oy)); min-width: calc(44px * var(--oy)); padding: calc(4px * var(--oy)) calc(6px * var(--oy)); }
@media (orientation: portrait) {
  html:not([data-cihaz="masaustu"])[data-tablet] .hud-dugmeler .dugme.ikon { padding: calc(2px * var(--oy)); font-size: .68em; min-height: calc(52px * var(--oy)); }
}
/* oyun ekranı (yatay tablet): sol HUD sütunu + sağ D-pad sütunu telefon yatay oranında (140 / 176 px × o + kenar payı) */
@media (orientation: landscape) {
  html:not([data-cihaz="masaustu"])[data-tablet] { --kenar-sol: 32px; --kenar-sag: 32px; }
  html:not([data-cihaz="masaustu"])[data-tablet] #ekran-oyun { grid-template-columns: calc(140px * var(--oy) + var(--kenar-sol)) minmax(0, 1fr) calc(176px * var(--oy) + var(--kenar-sag)); }
  html:not([data-cihaz="masaustu"])[data-tablet] .hud { padding: calc(8px * var(--oy)) calc(6px * var(--oy)) calc(8px * var(--oy)) var(--kenar-sol); }
  html:not([data-cihaz="masaustu"])[data-tablet] .istatistik { grid-template-columns: 1fr 1fr; }
  html:not([data-cihaz="masaustu"])[data-tablet] .hud-dugmeler .dugme { min-height: calc(48px * var(--oy)); }
  html:not([data-cihaz="masaustu"])[data-tablet] .kontrol { align-items: flex-end; justify-content: flex-end; padding: calc(8px * var(--oy)) var(--kenar-sag) calc(10px * var(--oy)) 0; }
  html:not([data-cihaz="masaustu"])[data-tablet] .seviye-izgara { grid-template-columns: repeat(10, minmax(calc(48px * var(--o)), 1fr)); max-width: calc(820px * var(--o)); }
  html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik { gap: calc(5px * var(--o)); padding: calc(4px * var(--o)) calc(16px * var(--o)); }   /* 1280x800: menü satırı kesilmesin */
}

/* kartlar ve pencereler (kazanma, öğretici, ipucu onayı, premium, bildirim izni, sıfırlama) */
html:not([data-cihaz="masaustu"])[data-tablet] .kart-perde, html:not([data-cihaz="masaustu"])[data-tablet] #ekran-premium, html:not([data-cihaz="masaustu"])[data-tablet] #ekran-bildirim { padding: calc(16px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .kart { min-width: calc(240px * var(--o)); padding: calc(18px * var(--o)) calc(22px * var(--o)); font-size: 1rem;
  border-width: calc(3px * var(--o)); border-radius: calc(10px * var(--o)); box-shadow: 0 calc(6px * var(--o)) 0 #0008; }
html:not([data-cihaz="masaustu"])[data-tablet] .kart .dugme { font-size: 1rem; }
html:not([data-cihaz="masaustu"])[data-tablet] .kart h2 { margin-bottom: calc(6px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .yildizlar { letter-spacing: calc(6px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .kart-satir { margin: calc(4px * var(--o)) 0; }
html:not([data-cihaz="masaustu"])[data-tablet] .kart-dugmeler { gap: calc(10px * var(--o)); margin-top: calc(12px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .ogretici-liste li { margin: calc(6px * var(--o)) 0; }
html:not([data-cihaz="masaustu"])[data-tablet] .ipucu-onay-kart { max-width: calc(320px * var(--o)); min-width: 0; }
html:not([data-cihaz="masaustu"])[data-tablet] .premium-modal { width: min(calc(340px * var(--o)), 100%); padding: calc(18px * var(--o)) calc(18px * var(--o)) calc(14px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .premium-modal h2 { margin: calc(4px * var(--o)) calc(28px * var(--o)) calc(10px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .premium-kapat { top: calc(6px * var(--o)); right: calc(6px * var(--o)); min-width: calc(40px * var(--o)); min-height: calc(40px * var(--o)); padding: 0; }
html:not([data-cihaz="masaustu"])[data-tablet] .premium-faydalar { gap: calc(8px * var(--o)); margin-bottom: calc(12px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .premium-faydalar li { gap: calc(10px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .premium-faydalar li::before { width: calc(24px * var(--o)); height: calc(24px * var(--o)); border-radius: calc(4px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .premium-modal .premium-fiyat { margin: calc(4px * var(--o)) 0 calc(10px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .premium-modal .premium-dugmeler .dugme { min-height: calc(48px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .premium-modal .premium-rozet { margin-bottom: calc(10px * var(--o)); padding: calc(2px * var(--o)) calc(6px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .bildirim-modal .bildirim-ikon { width: calc(48px * var(--o)); height: calc(48px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .bildirim-dugmeler { gap: calc(8px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .bildirim-dugmeler .dugme { min-height: calc(48px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .sifirla-onay { padding: calc(10px * var(--o)); border-width: calc(2px * var(--o)); border-radius: calc(8px * var(--o)); }

/* ayarlar */
html:not([data-cihaz="masaustu"])[data-tablet] .ayar-liste { max-width: calc(480px * var(--o)); gap: calc(10px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .ayar-satir { gap: calc(10px * var(--o)); padding: calc(8px * var(--o)) calc(10px * var(--o)); min-height: calc(52px * var(--o)); border-radius: calc(6px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .ayar-satir select { min-height: calc(44px * var(--o)); padding: calc(4px * var(--o)) calc(6px * var(--o)); border-width: calc(2px * var(--o)); border-radius: calc(6px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .ayar-yuzde input[type="range"] { height: calc(32px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .anahtar { width: calc(28px * var(--o)); height: calc(28px * var(--o)); margin: 0 calc(6px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] button.ayar-bag { padding: calc(6px * var(--o)); min-height: calc(32px * var(--o)); }

/* başarımlar + rozet bildirimi */
html:not([data-cihaz="masaustu"])[data-tablet] .basarim-liste { max-width: calc(560px * var(--o)); gap: calc(8px * var(--o)); padding: calc(2px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .basarim-liste li { gap: calc(10px * var(--o)); padding: calc(8px * var(--o)) calc(10px * var(--o)); border-width: calc(2px * var(--o)); border-radius: calc(6px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .basarim-liste .rozet-ikon, html:not([data-cihaz="masaustu"])[data-tablet] .rozet .rozet-ikon { width: calc(45px * var(--o)); height: calc(45px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .bk-govde { gap: calc(3px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .bk-kademe { gap: calc(3px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .kademe { width: calc(9px * var(--o)); height: calc(9px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .bk-cubuk { height: calc(6px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .rozet { gap: calc(10px * var(--o)); max-width: min(92vw, calc(420px * var(--o))); padding: calc(8px * var(--o)) calc(14px * var(--o));
  border-width: calc(3px * var(--o)); border-radius: calc(8px * var(--o)); }
/* gizlilik penceresi + çıkış uyarısı */
html:not([data-cihaz="masaustu"])[data-tablet] .gizlilik-ust { gap: calc(12px * var(--o)); padding: calc(10px * var(--o)) calc(12px * var(--o)) calc(10px * var(--o)) calc(16px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .gizlilik-kapat { min-width: calc(44px * var(--o)); min-height: calc(44px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .gizlilik-icerik { padding: calc(8px * var(--o)) calc(16px * var(--o)) calc(32px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .cikis-toast { bottom: calc(32px * var(--o) + env(safe-area-inset-bottom)); padding: calc(8px * var(--o)) calc(16px * var(--o)); border-radius: calc(18px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] .kart .dugme.buyuk { padding: calc(12px * var(--o)) calc(28px * var(--o)); font-size: 1.15rem; }

/* PD-DUZELT-1: Seviyeler kare düğmesi tablette --o ile */
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .oyna-satir { gap: calc(20px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .seviyeler-dugme { border-width: calc(6px * var(--o)); border-image-width: calc(6px * var(--o)); }
html:not([data-cihaz="masaustu"])[data-tablet] #ekran-baslik .seviyeler-dugme .px-ikon { width: calc(32px * var(--o-tam, var(--o))); height: calc(32px * var(--o-tam, var(--o))); }



