/* ============================================================
   KITTY RUNNA: MOBİL SİSTEM (mobil1, 2026-11-28)
   Telefona özel bütün kurallar mobil/ klasöründe, bu sırayla yüklenir:
     temel.css  belirteçler, ortak, yan çevir kapısı, oyun içi (kontroller, HUD, kenar bantları)
     menu.css   ana menü, ayarlar, görevler, şöhret/liderlik, duraklat, oyun sonu
     dolap.css  mağaza, dolap (kostüm), hediye paketi
     online.css lobi, oda kur/katıl, oda sahnesi, yarış HUD, izleyici, sonuç
     bahce.css  bahçe
   KATMAN KARARI: dosyalar KATMANSIZ ve en son yüklenir (index.html'de bahce.css'ten sonra).
     - style.css '@layer base' içinde; katmansız her kural onu özgüllükten bağımsız yener.
     - kit/online/hud/missions/locker/bahce/desktop.css katmansız; eşit özgüllükte
       sonra yüklenen kazanır, bu yüzden mobil/ en sonda.
     - Tek bir '@layer mobil' kullanılamaz: katmanlı normal kural katmansız kurala her
       durumda kaybeder (eski mobile.css'in '@layer mobile' sorunu buydu).
     - Sınır: style.css '@layer base' içindeki !important bildirimleri katmansız !important'ı
       yener (!important'ta sıra tersine döner). Telefonda base !important'ı ezmek gerekirse
       onu style.css'te kaldırın; burada !important yığmayın.
   TAŞIMA KURALI (Faz 1 görünümü değiştirmedi; Chromium + WebKit öncesi/sonrası ölçüldü):
     - Eski mobile.css '@layer mobile' kuralları buraya katmansız taşındı. Bir katmansız
       kurala KAYBETTİĞİ ölçülen bildirimler '@layer mobile{}' bloğunda kaldı (notu:
       "eski katman"). Bunlar bugün ekranda etkisiz ya da kısmen etkili; Faz 2 ekranı
       yeniden yazarken bunları silip katmansız yazar.
     - style.css '@layer base' alçak-yatay bloklarında aynı durumdaki bildirimler
       style.css'te kaldı (taşınsaydı kazanmaya başlayacaklardı).
     - env(safe-area-inset-*) taşınan kurallarda var(--sa-*) oldu (aynı değer).
   Telefon tetiği: index.html body başındaki betik body.is-mobile basar (game.js IS_MOBILE).
   Medya sorgusu "(orientation:landscape) and (max-height:600px) and (max-width:799px), ...
     (pointer:coarse)" olan bloklar (alçak yatay düzen) 800px'den dar masaüstü pencereye de
     uyar; telefon düzeninin masaüstü önizlemesi oldukları için buraya taşındı.
   ============================================================ */

/* ---------- 0. BELİRTEÇLER (yeni; Faz 2 bunları kullanır) ---------- */
:root{
  --sa-t:env(safe-area-inset-top); --sa-r:env(safe-area-inset-right);
  --sa-b:env(safe-area-inset-bottom); --sa-l:env(safe-area-inset-left);
  --vh-use:100vh;            /* kullanılabilir yükseklik (tarayıcı çubukları düşülmüş) */
  --tap:44px;                /* en küçük dokunma hedefi (zorunlu yerde 40px) */
  --fs-min:10px;             /* en küçük yazı */
}
@supports (height:100dvh){ :root{ --vh-use:100dvh; } }

/* ============================================================
   1. YAN ÇEVİR KAPISI (dikey telefon)
   Faz 3: menüde de oyunda da (html.s-play) aynı tam ekran perde. Gece göğü + pixel
   nokta deseni + alt şeritte çim ve toprak; ortada krem kart (ink kenar, pembe sert
   gölge), döndürme ikonu yatay konuma döner ve bekler; çimde küçük kedi zıplar.
   Oyunda dokunuşlar perdeden geçmez (pointer-events:auto): arkadaki tuval zıplatmaz.
   ============================================================ */
/* kaynak: style.css @layer base (telefon sayılmayan dikey dokunmatik cihaz: küçük üst ipucu) */
@media (orientation:portrait) and (pointer:coarse){
  html.s-play .rotate-hint{ align-items:center; left:50%;
    top:calc(14px + var(--sa-t)); transform:translateX(-50%); z-index:120; color:#ffe3f0; font-family:'Press Start 2P',monospace;
    font-size:8px; letter-spacing:.5px;
    pointer-events:none; white-space:nowrap;
  }
}
@media (orientation:portrait){
  @layer mobile{   /* eski katman: katmansız bir kurala kaybeder */
    body.is-mobile .scene{ display:none; }
  }
  body.is-mobile .theme-btn, body.is-mobile .pause-btn, body.is-mobile .ms-bubble{ display:none !important; }
  body.is-mobile .rotate-hint{
    --rh-gnd:calc(88px + var(--sa-b));
    position:fixed; inset:0; z-index:9000; display:flex; flex-direction:column; align-items:center; justify-content:center;
    margin:0; padding:calc(24px + var(--sa-t)) calc(20px + var(--sa-r)) calc(var(--rh-gnd) + 24px) calc(20px + var(--sa-l));
    transform:none; animation:none; border:0; border-radius:0; box-shadow:none; max-width:none; overflow:hidden;
    pointer-events:auto; touch-action:none; white-space:normal; text-align:center;
    font-family:'Press Start 2P',monospace; font-size:11px; color:#fff8fb;
    background:
      linear-gradient(to top, #3d2846 0 calc(var(--rh-gnd) - 12px), #4fae82 0 calc(var(--rh-gnd) - 6px), #6fc79c 0 var(--rh-gnd), transparent 0),
      radial-gradient(circle, rgba(255,210,230,.16) 1.5px, transparent 2px) 0 0/16px 16px,
      radial-gradient(120% 80% at 50% 0%, #3a2752, #1b1426 72%);
  }
  body.is-mobile .rotate-hint::before{ content:none; }
  body.is-mobile .rotate-hint .rh-card{
    display:flex; flex-direction:column; align-items:center; gap:20px;
    width:min(300px, 100%); padding:28px 18px 26px;
    background:#fff8fb; border:4px solid #1d1428; border-radius:16px;
    box-shadow:6px 6px 0 #e84d92, inset 0 -6px 0 #f6dbe8;
    animation:rhCardIn .32s cubic-bezier(.34,1.56,.64,1) both;
  }
  body.is-mobile .rotate-hint .rh-ico{
    display:block; width:80px; height:80px; line-height:0;
    content:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 16 16' shape-rendering='crispEdges'><g fill='%23e84d92'><rect x='5' y='2' width='6' height='2'/><rect x='4' y='4' width='2' height='8'/><rect x='10' y='4' width='2' height='8'/><rect x='5' y='12' width='6' height='2'/></g><g fill='%23ffd2e6'><rect x='6' y='5' width='4' height='6'/></g><g fill='%23ffd34d'><rect x='1' y='7' width='2' height='2'/><rect x='13' y='7' width='2' height='2'/><rect x='2' y='5' width='2' height='2'/><rect x='12' y='9' width='2' height='2'/></g></svg>");
    filter:drop-shadow(3px 3px 0 #1d1428);
    animation:rhTurn 2.6s ease-in-out infinite;
  }
  body.is-mobile .rotate-hint .rh-t{
    display:block; max-width:10em; font-weight:400; font-size:clamp(16px, 5vw, 20px); line-height:1.6; letter-spacing:1px; color:#ff6fae;
    text-shadow:-2px 0 0 #1d1428, 2px 0 0 #1d1428, 0 -2px 0 #1d1428, 0 2px 0 #1d1428,
      -2px -2px 0 #1d1428, 2px -2px 0 #1d1428, -2px 2px 0 #1d1428, 2px 2px 0 #1d1428, 3px 4px 0 #1d1428;
  }
  /* çimde bekleyen kedi (özgün 16x16 pixel çizim; kontur drop-shadow ile tek hücre) */
  body.is-mobile .rotate-hint .rh-char{
    display:block; position:absolute; left:50%; bottom:calc(var(--rh-gnd) - 6px); width:64px; height:64px; margin-left:-32px; line-height:0;
    content:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 16 16' shape-rendering='crispEdges'><g fill='%23fff8fb'><rect x='2' y='1' width='1' height='1'/><rect x='2' y='2' width='2' height='1'/><rect x='2' y='3' width='3' height='1'/><rect x='13' y='1' width='1' height='1'/><rect x='12' y='2' width='2' height='1'/><rect x='11' y='3' width='3' height='1'/><rect x='2' y='4' width='12' height='7'/><rect x='5' y='12' width='6' height='2'/><rect x='5' y='14' width='2' height='1'/><rect x='9' y='14' width='2' height='1'/></g><g fill='%23b89ad0'><rect x='5' y='4' width='1' height='1'/><rect x='7' y='4' width='2' height='2'/><rect x='10' y='4' width='1' height='1'/><rect x='13' y='10' width='1' height='2'/><rect x='11' y='12' width='3' height='1'/></g><g fill='%23ff9fc8'><rect x='3' y='3' width='1' height='1'/><rect x='12' y='3' width='1' height='1'/><rect x='3' y='9' width='2' height='1'/><rect x='11' y='9' width='2' height='1'/><rect x='7' y='9' width='2' height='1'/></g><g fill='%231d1428'><rect x='4' y='7' width='2' height='2'/><rect x='10' y='7' width='2' height='2'/></g><g fill='%23fff8fb'><rect x='5' y='7' width='1' height='1'/><rect x='11' y='7' width='1' height='1'/></g><g fill='%23e84d92'><rect x='3' y='11' width='10' height='1'/><rect x='9' y='12' width='2' height='2'/></g></svg>");
    filter:drop-shadow(4px 0 0 #1d1428) drop-shadow(-4px 0 0 #1d1428) drop-shadow(0 4px 0 #1d1428) drop-shadow(0 -4px 0 #1d1428);
    transform-origin:50% 100%; animation:rhHop 2.6s ease-in-out infinite;
  }
}
@keyframes rhTurn{ 0%,16%{ transform:rotate(0deg); } 34%{ transform:rotate(-100deg); } 42%{ transform:rotate(-86deg); } 48%,82%{ transform:rotate(-90deg); } 100%{ transform:rotate(0deg); } }
@keyframes rhHop{ 0%,40%,62%,100%{ transform:none; } 46%{ transform:translateY(-14px) scale(.96,1.04); } 54%{ transform:none; } 58%{ transform:scale(1.08,.92); } }
@keyframes rhCardIn{ from{ opacity:0; transform:translateY(12px) scale(.94); } }

/* ============================================================
   2. OYUN İÇİ (kontroller, HUD, kenar bantları)
   ============================================================ */
/* kaynak: style.css @layer base */
@media (hover:none),(pointer:coarse){
  .emote-bar button:hover{ transform:none; }
  .emote-bar button:active{ transform:scale(.88); }
  #game{ touch-action:none; }
}
/* kaynak: mobile.css @layer mobile */
/* NOT: .spec-btn'in konumu style.css'te @layer DIŞINDA yazılı (katmansız kural
   @layer mobile'ı yener) → right/bottom oraya yazıldı, burada tekrarlanmaz. */
/* ============================================================
   FAZ 1 — OYUN-İÇİ KONTROLLER (sıfırdan, pixel-art kimlik + görüşü kapatmayan yarı-saydam dolgu)
   base'deki glass stilini @layer ile !important'sız yener. Gerçek viewport köşeleri + safe-area.
   ============================================================ */
body.is-mobile .dash-btn, body.is-mobile .duck-btn{ z-index:60; cursor:pointer;
  bottom:calc(var(--m-edge) + var(--sa-b));   /* daire DEĞİL, pixel kare-yuvarlatılmış */
  align-items:center; justify-content:center; image-rendering:pixelated;
  -webkit-tap-highlight-color:transparent; touch-action:manipulation;
}
@layer mobile{   /* eski katman: katmansız bir kurala kaybeder */
  body.is-mobile .dash-btn, body.is-mobile .duck-btn{
    position:fixed; display:none; padding:0;
    width:var(--m-hit-act); height:var(--m-hit-act);
    border:3px solid var(--ink); border-radius:var(--m-r3);
    box-shadow:var(--m-sh2), var(--m-inset);
  }
}
body.is-mobile .duck-btn{ left:calc(var(--m-edge) + var(--sa-l)); }
@layer mobile{   /* eski katman: katmansız bir kurala kaybeder */
  body.is-mobile .duck-btn{ background:rgba(232,77,146,.6); }
}
body.is-mobile .dash-btn{ right:calc(var(--m-edge) + var(--sa-r)); }
@layer mobile{   /* eski katman: katmansız bir kurala kaybeder */
  body.is-mobile .dash-btn{ background:rgba(47,134,214,.6); }
}
@layer mobile{   /* eski katman: katmansız bir kurala kaybeder */
  body.is-mobile .dash-btn.show, body.is-mobile .duck-btn.show{ display:flex; animation:tbPop .2s cubic-bezier(.34,1.56,.64,1); }
}
@layer mobile{   /* eski katman: katmansız bir kurala kaybeder */
  body.is-mobile .duck-btn:active, body.is-mobile .duck-btn.held{ transform:translate(3px,3px); background:rgba(232,77,146,.82); box-shadow:var(--m-sh-press), var(--m-inset); }
}
@layer mobile{   /* eski katman: katmansız bir kurala kaybeder */
  body.is-mobile .dash-btn:active{ transform:translate(3px,3px); background:rgba(47,134,214,.82); box-shadow:var(--m-sh-press), var(--m-inset); }
}
@layer mobile{   /* eski katman: katmansız bir kurala kaybeder */
  body.is-mobile .dash-btn .dash-chev{ width:26px; height:21px; filter:drop-shadow(0 1px 0 rgba(0,0,0,.55)); }
}
@layer mobile{   /* eski katman: katmansız bir kurala kaybeder */
  body.is-mobile .duck-btn .duck-chev{ width:28px; height:28px; filter:drop-shadow(0 1px 0 rgba(0,0,0,.55)); }
}
body.is-mobile .dash-btn b{ min-width:18px;
  font-size:var(--fs-min); color:#fff; }
@layer mobile{   /* eski katman: katmansız bir kurala kaybeder */
  body.is-mobile .dash-btn b{ right:-3px; top:-4px; border-radius:var(--m-r1); height:18px; background:var(--pink-deep); border:2px solid var(--ink); box-shadow:none; }
}
body.is-mobile .hud{
  grid-template-columns:auto auto 1fr auto;
  align-items:center; gap:10px;
  min-height:var(--m-hudh);
  font-size:10px;
}
@layer mobile{   /* eski katman: katmansız bir kurala kaybeder */
  body.is-mobile .hud{
    display:grid;
    padding:5px 10px;
  }
}
@layer mobile{   /* eski katman: katmansız bir kurala kaybeder */
  body.is-mobile .hud .hud-right{ display:contents; }
}
/* DOM sırası rekor→skor; grid-area ile skor SOLA alınır (masaüstüyle aynı gramer) */
body.is-mobile #hud-score{ grid-area:1/1; font-size:18px; letter-spacing:2px; transform-origin:left center; }
body.is-mobile #hud-best { grid-area:1/2; font-size:var(--fs-min); }
@layer mobile{   /* eski katman: katmansız bir kurala kaybeder */
  body.is-mobile #hud-best { padding:3px 6px; }
}
body.is-mobile #hud-combo{ grid-area:1/3; justify-self:start; font-size:var(--fs-min); }
@layer mobile{   /* eski katman: katmansız bir kurala kaybeder */
  body.is-mobile #hud-combo{ padding:3px 6px; }
}
body.is-mobile .hud-pw   { grid-area:1/4; justify-self:end; }
@layer mobile{   /* eski katman: katmansız bir kurala kaybeder */
  body.is-mobile .hud-pw   { margin:0; }
}
/* Kontroller panelin üstünde başlar: panel yüksekliği + 8px nefes payı.
   (Eskiden 14px idi ve HUD metinlerinin tam üstüne oturuyordu.) */
/* 844x400'de ölçüldü: çerçeve y34-323, HUD paneli y332-366. Buton alt kenarı
   panelin 8px üstünde bitmeli → 34+42=76px. Özel güç bir kat yukarı: 34+114=148px.
   Yan paylar 14→18px: çerçeve viewport'tan 16px içeride, 14px'te butonlar
   çerçevenin dışına taşıyordu. */
body.is-mobile .dash-btn, body.is-mobile .duck-btn{
  bottom:calc(var(--m-hudh) + 42px + var(--sa-b));
}
body.is-mobile .dash-btn{ right:calc(18px + var(--sa-r)); }
body.is-mobile .duck-btn{ left:calc(18px + var(--sa-l)); }
/* ÖZEL GÜÇ butonu: sayaç okunur olsun, hazır olunca karakterin renginde nabız */
@layer mobile{   /* eski katman: katmansız bir kurala kaybeder */
  body.is-mobile .spec-btn{ width:60px; height:60px; bottom:calc(84px + var(--sa-b)); }
}
@layer mobile{   /* eski katman: katmansız bir kurala kaybeder */
  body.is-mobile .spec-btn b{ font-size:var(--fs-min); }
}
@layer mobile{   /* eski katman: katmansız bir kurala kaybeder */
  body.is-mobile .spec-btn.ready{ animation:specRdy 1.1s ease-in-out infinite; }
}
@media (orientation:landscape){
  /* şerit + çerçeve dikey bütçeye sığsın */
  body.is-mobile .scene{
    width:min(780px, calc(100% - 108px));
    height:calc(100dvh - 12px);
    gap:0;
    justify-content:flex-start;
  }
  body.is-mobile .frame{ flex:none; margin-top:auto; margin-bottom:auto; }
  /* serit disinda kalan bosluk cerceveyi dikey ortalar */
  /* skor plakası şeridin ORTASINDA: iki aksiyon sütununun arasında kalır */
  body.is-mobile .hud{
    margin:0 auto 4px;   /* alt kenar aksiyon tuslariyla ayni hizada bitsin */
    width:min(340px, calc(100% - 2 * (var(--m-act) + 28px)));
    min-height:var(--m-act);
    justify-content:center;
  }
  /* aksiyon tuşları: aynı şerit bandı, 56px kaide */
  body.is-mobile .dash-btn,
  body.is-mobile .duck-btn,
  body.is-mobile .spec-btn{
    width:var(--m-act); height:var(--m-act);
    bottom:calc(10px + var(--sa-b));
    border-radius:var(--k-r-btn-sm,10px);
  }
  body.is-mobile .duck-btn{ left:calc(10px + var(--sa-l)); }
  body.is-mobile .dash-btn{ right:calc(10px + var(--sa-r)); }
  body.is-mobile .spec-btn{ right:calc(10px + var(--m-act) + 8px + var(--sa-r)); }
  /* onboarding ipuçları çerçevenin İÇİNDE üstte; ray solda olduğu için
     sağ yarıya yaslanır ve rayla çakışmaz */
  body.is-mobile #ctrlHint.ctrl-hint,
  body.is-mobile #cueTip.cue-tip{
    top:calc(8px); left:auto; right:12px; bottom:auto; transform:none;
    font-size:var(--fs-min); padding:6px 10px; max-width:52%;
  }
}
/* ============================================================
   TAM EKRAN OYUN — telefon, yatay, oyun sırasında (2026-11-11)
   ------------------------------------------------------------
   ÖNCE: oyun 3px konturlu küçük bir kutuda (.frame), solunda 6'lı emote
   sütunu, altında ayrı skor kutusu, alt köşelerde kutu tuşlar; ekranın
   ~üçte biri oyuna ait değildi.
   SONRA: canvas kenardan kenara (iç çözünürlük 900x320 SABİT, yalnız CSS
   ölçeği). Ekran canvas'tan uzunsa kalan üst/alt şerit (genişse sol/sağ)
   game.js edgeBands ile canvas'ın kenar satırının kopyası, gök ve toprak
   kesintisiz. HUD oyunun üstünde, kutusuz; tuşlar yüzen çıkartmalar.
   Kapı: html.s-play (game.js, yalnız IS_MOBILE + state==='play') +
   body.is-mobile + yatay. Masaüstü/menü/sonuç ekranları bu bloğu görmez.
   KATMANSIZ: kit.css / hud.css / online.css katmansız ve SONRA yükleniyor;
   html.s-play öneki (0,2,2)+ ile onları spesifiklikten yener.
   Konum değişkenleri (hepsi CSS px):
     --kw/--kh  canvas'ın ekrandaki boyu (contain)
     --ktop     üst şerit = boşluğun %40'ı (tuşlar alttaki toprak bandında kalsın)
     --kleft    yan şerit (yalnız 2.81:1'den geniş ekranda > 0)
     --ks       1 dünya pikselinin CSS karşılığı (kalpler/ray hizası)
   ============================================================ */
.edge-band{ display:none; }
#emoteBar .emote-tog{ display:none; }
/* masaüstü + menü: yok (emote şeridi aynen kalır) */
@keyframes mSpecRdy{
  0%,100%{ box-shadow:0 0 0 3px #fff8fb, 3px 4px 0 3px rgba(20,10,30,.6), inset 3px 3px 0 0 color-mix(in oklab, var(--kc) 70%, #fff), inset -3px -3px 0 0 color-mix(in oklab, var(--kc) 68%, #000); }
  50%    { box-shadow:0 0 0 3px var(--ab-col,#e84d92), 3px 4px 0 3px rgba(20,10,30,.6), inset 3px 3px 0 0 color-mix(in oklab, var(--kc) 70%, #fff), inset -3px -3px 0 0 color-mix(in oklab, var(--kc) 68%, #000); }
}
@media (orientation:landscape){
  html.s-play body.is-mobile{
    --kw:min(100vw, calc(100dvh * 2.8125));
    --kh:calc(var(--kw) * .355556);
    --ktop:max(0px, calc((100dvh - var(--kh)) * .4));
    --kleft:max(0px, calc((100vw - var(--kw)) / 2));
    --ks:calc(var(--kw) / 900);
    --m-act:64px; --m-gap:20px;   /* G3: DS aksiyon tuşu min 64; dash/özel arası 20 (yanlış dokunma) */
    --m-pad-t:calc(6px + env(safe-area-inset-top, 0px));
    --m-pad-b:calc(12px + env(safe-area-inset-bottom, 0px));
    --m-pad-l:calc(14px + env(safe-area-inset-left, 0px));
    --m-pad-r:calc(14px + env(safe-area-inset-right, 0px));
    --m-ink:#1d1428; --m-cream:#fff8fb;
    --m-ol:-1px 0 0 var(--m-ink), 1px 0 0 var(--m-ink), 0 -1px 0 var(--m-ink), 0 1px 0 var(--m-ink);
  }
  /* tuş gölgesi --kc'ye bağlı → her tuşun KENDİ elemanında çözülsün diye orada tanımlı */
  html.s-play body.is-mobile :is(.duck-btn, .dash-btn, .spec-btn, .emote-tog){
    --m-btn-sh:0 0 0 3px var(--m-cream), 3px 4px 0 3px rgba(20,10,30,.6),
      inset 3px 3px 0 0 color-mix(in oklab, var(--kc) 70%, #fff), inset -3px -3px 0 0 color-mix(in oklab, var(--kc) 68%, #000);
    --m-btn-sh-press:0 0 0 3px var(--m-cream), 1px 2px 0 3px rgba(20,10,30,.6),
      inset 3px 3px 0 0 color-mix(in oklab, var(--kc) 68%, #000), inset -3px -3px 0 0 color-mix(in oklab, var(--kc) 70%, #fff);
  }
  /* ---------- sahne: kenardan kenara ---------- */
  html.s-play body.is-mobile .scene{
    position:fixed; inset:0; width:auto; height:auto; max-width:none;
    margin:0; padding:0; gap:0; display:block; z-index:3;
  }
  html.s-play body.is-mobile .frame{
    position:absolute; left:var(--kleft); top:var(--ktop);
    width:var(--kw); height:var(--kh); margin:0; flex:none; aspect-ratio:auto;
    border:0; border-radius:0; background:var(--k-panel,#231a31); box-shadow:none;   /* sarsıntıda açılan kenar pikseli koyu kalsın (eski çerçeveyle aynı) */
    overflow:visible;          /* çocuklar şeritlere taşabilsin; canvas zaten kutuyu tam dolduruyor */
  }
  html.s-play body.is-mobile .frame::after{ display:none; }
  /* bezel + biome halkası: çerçeve yok */
  html.s-play body.is-mobile .frame.juice{ animation:none; }
  /* tam ekranda ölçek sarsıntısı şeritle dikiş açardı */
  html.s-play body.is-mobile #game{ width:100%; height:100%; }
  html.s-play body.is-mobile #fx.fx-layer{ inset:auto; left:var(--kleft); top:var(--ktop); width:var(--kw); height:var(--kh); }
  /* kenar şeritleri: 2px canvas'ın altına girer (alt piksel yuvarlamasında boşluk kalmaz) */
  html.s-play body.is-mobile .edge-band{ display:block; position:absolute; image-rendering:pixelated; touch-action:none; background:var(--k-panel,#231a31); }
  html.s-play body.is-mobile #edgeT{ left:0; top:0; width:100%; height:calc(var(--ktop) + 2px); }
  html.s-play body.is-mobile #edgeB{ left:0; width:100%; top:calc(var(--ktop) + var(--kh) - 2px); height:calc(100dvh - var(--ktop) - var(--kh) + 2px); }
  html.s-play body.is-mobile #edgeL{ left:0; top:var(--ktop); height:var(--kh); width:calc(var(--kleft) + 2px); }
  html.s-play body.is-mobile #edgeR{ right:0; top:var(--ktop); height:var(--kh); width:calc(var(--kleft) + 2px); }
  /* ---------- SKOR: üst orta, kutusuz, pembe pixel rakam + sert ink kontur ---------- */
  html.s-play body.is-mobile .hud{
    position:fixed; top:var(--m-pad-t); left:50%; transform:translateX(-50%);
    /* grid: kutu genişliği = max(skor, HI + ping) → kenar kutusu rayın üstüne taşmaz */
    display:grid; grid-template-columns:auto auto; justify-content:center; justify-items:center; align-items:center; gap:3px 0;
    width:max-content; max-width:46vw; min-height:0; margin:0; padding:0;
    background:none; border:0; border-radius:0; box-shadow:none;
    pointer-events:none; z-index:46;
  }
  html.s-play body.is-mobile #hud-score{
    --kc:#ff6fae;
    grid-area:auto; grid-column:1 / -1; text-align:center;
    font-size:24px; line-height:1; letter-spacing:2px; transform-origin:center;
    color:var(--kc);
    text-shadow:
      0 -1px 0 color-mix(in oklab, var(--kc) 58%, #fff),
      0  1px 0 color-mix(in oklab, var(--kc) 66%, #000),
      -2px 0 0 var(--m-ink), 2px 0 0 var(--m-ink), 0 -2px 0 var(--m-ink), 0 2px 0 var(--m-ink),
      -2px -2px 0 var(--m-ink), 2px -2px 0 var(--m-ink), -2px 2px 0 var(--m-ink), 2px 2px 0 var(--m-ink),
      3px 4px 0 var(--m-ink);
  }
  html.s-play body.is-mobile #hud-score.rec{ --kc:#ffd34d; }
  html.s-play body.is-mobile #hud-best{
    grid-area:auto; grid-column:1; grid-row:2; padding:3px 6px 2px; border:2px solid var(--m-ink); border-radius:6px; box-shadow:2px 2px 0 var(--m-ink);
    font-size:var(--fs-min);   /* Faz 3: 8 → 10 px */ line-height:1; letter-spacing:1px; color:var(--m-cream); white-space:nowrap;
    /* G3: HI çipi opak (açık biome'da okunur) + skor rekora yaklaştıkça pembe dolar (--hi, game.js) */
    background:linear-gradient(90deg, #e8539a 0 calc(var(--hi,0) * 1%), #2a1d3a calc(var(--hi,0) * 1%));
    text-shadow:var(--m-ol);
  }
  /* rekor kırıldı: tek vurgu anı = skorun solunda çentikli kurdele */
  html.s-play body.is-mobile #hud-score{ position:relative; }
  html.s-play body.is-mobile #hud-score.rec::before{
    content:'REKOR'; position:absolute; right:calc(100% + 8px); top:3px;
    padding:4px 9px 3px 7px; font-size:var(--fs-min); letter-spacing:1px; line-height:1; color:var(--m-ink); text-shadow:none;
    background:#ffd34d; clip-path:polygon(0 0,100% 0,88% 50%,100% 100%,0 100%);
    filter:drop-shadow(2px 2px 0 var(--m-ink)); animation:mRecIn .3s cubic-bezier(.34,1.56,.64,1) both;
  }
  html.s-play body.is-mobile #hud-combo{
    position:absolute; left:calc(100% + 6px); top:2px; grid-area:auto; margin:0;
    font-size:var(--fs-min); padding:3px 6px; white-space:nowrap;   /* Faz 3: 9 → 10 px */
  }
  html.s-play body.is-mobile #ctrlHint.ctrl-hint{
    top:calc(var(--ks) * 70 + 6px); left:50%; right:auto; bottom:auto; transform:translateX(-50%); max-width:none;
  }
  html.s-play body.is-mobile #cueTip.cue-tip{ top:40%; left:50%; right:auto; bottom:auto; transform:translateX(-50%); max-width:none; }
  /* ---------- duraklat (solo): sağ üst köşe, küçük; online'da zaten gizli ---------- */
  html.s-play body.is-mobile .pause-btn{
    top:var(--m-pad-t); right:var(--m-pad-r); left:auto;   /* G3: kenar payı 14 */
    width:44px; height:44px; border-radius:10px; opacity:.85;
  }
  html.s-play body.is-mobile .pause-btn:active{ opacity:1; }
  /* ---------- DOKUNMATİK TUŞLAR: yüzen şeker çıkartmalar (ink kontur + krem kesim payı + sert gölge) ---------- */
  html.s-play body.is-mobile :is(.duck-btn, .dash-btn, .spec-btn){
    top:auto; bottom:var(--m-pad-b);
    width:var(--m-act); height:var(--m-act); padding:0; overflow:visible;
    border:3px solid var(--m-ink); border-radius:12px;
    background:var(--kc);
    box-shadow:var(--m-btn-sh);
    opacity:.72;
    transition:transform .06s steps(1,end), box-shadow .06s steps(1,end), opacity .12s steps(2,end);
  }
  html.s-play body.is-mobile .duck-btn{ left:var(--m-pad-l); right:auto; }
  html.s-play body.is-mobile .dash-btn{ right:var(--m-pad-r); left:auto; }
  html.s-play body.is-mobile .spec-btn{ right:calc(var(--m-pad-r) + var(--m-act) + var(--m-gap)); left:auto; }
  /* G3: bekleyen tuş yarı saydam değil (açık biome'da kayboluyordu): opak, koyulaşmış dolgu + aynı krem kesim payı */
  html.s-play body.is-mobile :is(.dash-btn, .spec-btn):not(.ready){ opacity:1; background:color-mix(in oklab, var(--kc) 42%, #2a1d3a); }
  html.s-play body.is-mobile :is(.dash-btn, .spec-btn):not(.ready) :is(.dash-chev, .sb-ico){ opacity:.7; }
  html.s-play body.is-mobile .duck-btn{ opacity:.9; }
  html.s-play body.is-mobile :is(.duck-btn, .dash-btn, .spec-btn):hover{ transform:none; box-shadow:var(--m-btn-sh); background:var(--kc); }
  html.s-play body.is-mobile :is(.duck-btn, .dash-btn, .spec-btn):active,
  html.s-play body.is-mobile .duck-btn.held{
    opacity:1; transform:translate(2px,2px); box-shadow:var(--m-btn-sh-press);
  }
  html.s-play body.is-mobile .spec-btn.ready{ animation:mSpecRdy 1.1s ease-in-out infinite; }
  /* fix9: hazır halkası yumuşak nefes (basamaklı yanıp sönme titreme gibi okunuyordu) */
  /* fix9 KALAN SÜRE: ÇALIŞIYOR = parlak dolgu yukarıdan aşağı boşalır (+ son saniye beyaz nabız),
     DOLUYOR = koyu tuşta yarı parlak dolgu aşağıdan yükselir. Dolguyu game.js (Web Animations, transform) sürer. */
  html.s-play body.is-mobile :is(.dash-btn, .spec-btn) :is(.tm-fill, .tm-warn){
    position:absolute; inset:0; border-radius:9px; pointer-events:none; z-index:0; display:block;
  }
  html.s-play body.is-mobile :is(.dash-btn, .spec-btn) .tm-fill{ transform-origin:50% 100%; transform:scaleY(0); opacity:0; }
  html.s-play body.is-mobile :is(.dash-btn, .spec-btn).tm-run .tm-fill{ opacity:1; background:color-mix(in oklab, var(--kc) 82%, #fff); }
  html.s-play body.is-mobile :is(.dash-btn, .spec-btn).tm-cd  .tm-fill{ opacity:1; background:color-mix(in oklab, var(--kc) 62%, #2a1d3a); }
  html.s-play body.is-mobile :is(.dash-btn, .spec-btn) .tm-warn{ background:#fff; opacity:0; }
  html.s-play body.is-mobile :is(.dash-btn, .spec-btn):is(.tm-run, .tm-cd) :is(.dash-chev, .sb-ico){ position:relative; z-index:1; opacity:1; }
  html.s-play body.is-mobile .spec-btn.tm-run b{ background:#ffd34d; color:var(--m-ink); }
  /* pencere süresi: canvas pod'daki altın saniye ile aynı */
  html.s-play body.is-mobile .spec-btn.ready:active{ animation:none; }
  /* glyph'ler tam kat: 10x10 → 30, 12x10 → 36x30, yetenek 12x12x3 → 36 (1:1) */
  html.s-play body.is-mobile .duck-btn .duck-chev{ width:30px; height:30px; filter:drop-shadow(2px 2px 0 rgba(20,10,30,.55)); }
  html.s-play body.is-mobile .dash-btn .dash-chev{ width:36px; height:30px; filter:drop-shadow(2px 2px 0 rgba(20,10,30,.55)); }
  html.s-play body.is-mobile .spec-btn .sb-ico,
  html.s-play body.is-mobile .spec-btn .sb-ico canvas{ width:36px; height:36px; }
  /* sayaç rozetleri köşeye taşar (kesim payının üstünde) */
  html.s-play body.is-mobile .dash-btn b,
  html.s-play body.is-mobile .spec-btn b{
    right:-8px; top:-10px; min-width:22px; height:20px; padding:0 4px;
    display:flex; align-items:center; justify-content:center;
    font-size:var(--fs-min);   /* Faz 3: 8 → 10 px */ line-height:1; border:2px solid var(--m-ink); border-radius:6px; box-shadow:2px 2px 0 var(--m-ink);
  }
  /* ---------- EMOTE (online yarış) — G3: tuş skorun SOLUNDA (sol üstte hayalet etiketlerinin üstüne biniyordu);
     açılınca tuştan aşağı küçük düşünce noktaları + 3x2 düşünce balonu kümesi (daire yayı kalıbı kalktı) ---------- */
  html.s-play body.is-mobile #emoteBar.emote-bar{
    position:fixed; left:auto; right:calc(50% + 84px); top:var(--m-pad-t); bottom:auto;
    width:44px; height:44px; margin:0; padding:0; gap:0; flex-direction:row;
    background:none; border:0; border-radius:0; box-shadow:none; z-index:58;
    display:none;
  }
  html.s-play body.is-mobile #emoteBar.emote-bar.show{ display:block; }
  html.s-play body.is-mobile #emoteBar .emote-tog{
    --kc:#fff8fb;
    position:absolute; left:0; top:0; z-index:2; display:flex; align-items:center; justify-content:center;
    width:44px; height:44px; padding:0; color:#e8539a;
    border:3px solid var(--m-ink); border-radius:12px; background:var(--kc);
    box-shadow:var(--m-btn-sh); opacity:.9;
    transition:transform .06s steps(1,end), opacity .12s steps(2,end);
  }
  html.s-play body.is-mobile #emoteBar .emote-tog svg{ width:28px; height:28px; display:block; }
  html.s-play body.is-mobile #emoteBar .emote-tog:hover{ transform:none; }
  html.s-play body.is-mobile #emoteBar .emote-tog:active{ opacity:1; transform:translate(2px,2px); box-shadow:var(--m-btn-sh-press); }
  html.s-play body.is-mobile #emoteBar.open .emote-tog{ --kc:#e8539a; color:var(--m-cream); opacity:1; }
  /* düşünce noktaları (tuş → küme) */
  html.s-play body.is-mobile #emoteBar::before,
  html.s-play body.is-mobile #emoteBar::after{
    content:''; position:absolute; z-index:1; background:var(--m-cream); border:2px solid var(--m-ink); border-radius:3px;
    opacity:0; transition:opacity .1s steps(2,end); pointer-events:none;
  }
  html.s-play body.is-mobile #emoteBar::before{ left:30px; top:50px; width:6px; height:6px; }
  html.s-play body.is-mobile #emoteBar::after{ left:40px; top:58px; width:10px; height:10px; }
  html.s-play body.is-mobile #emoteBar.open::before{ opacity:1; }
  html.s-play body.is-mobile #emoteBar.open::after{ opacity:1; transition-delay:40ms; }
  html.s-play body.is-mobile #emoteBar.emote-bar button[data-e]{
    position:absolute; left:0; top:0; z-index:1;
    width:44px; height:44px; border-width:3px; border-radius:14px;
    background:var(--m-cream); box-shadow:3px 3px 0 rgba(20,10,30,.6);
    transform:translate(20px,40px) scale(.3); opacity:0; visibility:hidden; pointer-events:none;
    transition:transform .14s ease-in, opacity .1s steps(2,end), visibility 0s linear .14s;
  }
  html.s-play body.is-mobile #emoteBar.emote-bar button[data-e] canvas{ width:30px; height:30px; }
  /* küme: hafif düzensiz bulut dizilimi (tuşun sağ altında, gökyüzünün üstünde; oyuncunun başına inmez) */
  html.s-play body.is-mobile #emoteBar.emote-bar button[data-e]:nth-child(2){ --fx:52px;  --fy:66px;  --i:0; }
  html.s-play body.is-mobile #emoteBar.emote-bar button[data-e]:nth-child(3){ --fx:102px; --fy:60px;  --i:1; }
  html.s-play body.is-mobile #emoteBar.emote-bar button[data-e]:nth-child(4){ --fx:152px; --fy:68px;  --i:2; }
  html.s-play body.is-mobile #emoteBar.emote-bar button[data-e]:nth-child(5){ --fx:64px;  --fy:116px; --i:3; }
  html.s-play body.is-mobile #emoteBar.emote-bar button[data-e]:nth-child(6){ --fx:114px; --fy:112px; --i:4; }
  html.s-play body.is-mobile #emoteBar.emote-bar button[data-e]:nth-child(7){ --fx:164px; --fy:118px; --i:5; }
  html.s-play body.is-mobile #emoteBar.emote-bar.open button[data-e]{
    transform:translate(var(--fx), var(--fy)) scale(1);
    opacity:1; visibility:visible; pointer-events:auto;
    transition:transform .3s cubic-bezier(.34,1.56,.64,1) calc(var(--i) * 24ms), opacity .1s steps(2,end) calc(var(--i) * 24ms), visibility 0s;
  }
  html.s-play body.is-mobile #emoteBar.emote-bar.open button[data-e]:active{
    transform:translate(calc(var(--fx) + 2px), calc(var(--fy) + 2px)) scale(.94);
    box-shadow:0 1px 0 rgba(20,10,30,.6);
  }
  /* G3: ipucu = yol kenarına dikilmiş pixel TABELA (koyu hap yerine): ahşap tahta + iki direk */
  html.s-play body.is-mobile #ctrlHint.ctrl-hint{
    background:#9a6a46; border:3px solid var(--m-ink); border-radius:4px;
    box-shadow:3px 3px 0 rgba(20,10,30,.5), inset 0 3px 0 #b98560, inset 0 -3px 0 #74492c;
    background-image:repeating-linear-gradient(180deg, transparent 0 7px, rgba(60,32,16,.28) 7px 8px);
    color:#fff8fb; text-shadow:1px 1px 0 var(--m-ink); padding:7px 12px; overflow:visible;
  }
  html.s-play body.is-mobile #ctrlHint.ctrl-hint::before,
  html.s-play body.is-mobile #ctrlHint.ctrl-hint::after{
    content:''; position:absolute; top:100%; width:6px; height:14px; background:#74492c; border:3px solid var(--m-ink); border-top:0;
  }
  html.s-play body.is-mobile #ctrlHint.ctrl-hint::before{ left:16%; }
  html.s-play body.is-mobile #ctrlHint.ctrl-hint::after{ right:16%; }
  @keyframes mRecIn{ from{ opacity:0; transform:translateX(10px) scale(.6); } to{ opacity:1; transform:none; } }
}
/* kaynak: hud.css */
/* mobil: dokunmatik kontrollerle çakışmayan yer — sol üstte, duraklat
   tuşunun ALTINDA dikey şerit (zıpla/eğil/dash sağ altta kalır) */
body.is-mobile #emoteBar.emote-bar{
  position:fixed; left:6px; top:58px; right:auto; bottom:auto;
  flex-direction:column; margin:0; padding:5px; gap:4px; z-index:46;
}
body.is-mobile #emoteBar.emote-bar button{ width:34px; height:34px; border-width:2px; border-radius:10px; }
body.is-mobile #emoteBar.emote-bar button canvas{ width:24px; height:24px; }
body.is-mobile #emoteBar.emote-bar button:hover{ transform:none; }
/* ------------------------------------------------------------
   MOBİL: tuş ipucu şeridi zemin bandındaki pod'un TAM ÜSTÜNE biniyordu
   (canvas 283px yüksek; pod 277..302, şerit 275..305 → tam çakışma).
   Alt bantta pod'un solu/sağı şeride yetmiyor (şerit 318px, boşluk 230px),
   sol alt köşede de eğil tuşu var. Şerit ilerleme rayının hemen ALTINA,
   boş gökyüzü bandına alındı (ray 49px, karakterin başı 180px).
   ------------------------------------------------------------ */
body.is-mobile .ctrl-hint{ top:56px; bottom:auto; }

/* ============================================================
   3. ORTAK (belirteçler, genel tuşlar, hareket azaltma)
   ============================================================ */
/* kaynak: style.css @layer base */
@media (hover:none), (pointer:coarse){
  .btn.tiny{ min-height:40px; }
}
/* Faz 3: sağ üst sistem tuşları (ayar/görev/müzik/tema) yatay telefonda 40 → 44 px dokunma hedefi.
   Adım 54 px aynı kalır (aradaki boşluk 14 → 10 px); sağ konumlar style.css (--tb-r + 54/108/162). */
@media (orientation:landscape){
  body.is-mobile .theme-btn{ top:calc(10px + var(--sa-t)); width:var(--tap); height:var(--tap); }   /* üst 14 → 10: liderlik kartının üst kenarına binmez */
}
/* kaynak: mobile.css @layer mobile */
/* ---- MOBİL LAYOUT TOKEN'LARI (--m- prefix; renk style.css'ten) ---- */
body.is-mobile{
  --m-1:4px; --m-2:8px; --m-3:12px; --m-4:16px; --m-5:20px; --m-6:24px;
  --m-edge:14px;
  --m-r1:4px; --m-r2:8px; --m-r3:10px;                 /* daire YOK; touch tavanı 10px */
  --m-sh1:2px 2px 0 var(--ink); --m-sh2:4px 4px 0 var(--ink); --m-sh-press:1px 1px 0 var(--ink);
  --m-inset: inset 2px 2px 0 rgba(255,255,255,.5), inset -2px -2px 0 rgba(0,0,0,.18);
  --m-scrim: rgba(20,10,30,.62);                        /* blur YOK */
  --m-fs-hero:clamp(20px,4.6vw,28px); --m-fs-name:clamp(14px,3vw,20px);
  --m-fs-cta:clamp(11px,2.4vw,14px);  --m-fs-body:clamp(10px,2vw,11px);
  --m-fs-label:clamp(9px,1.8vw,10px); --m-fs-hud:clamp(12px,2.6vw,15px);
  --m-hit-ui:48px; --m-hit-act:64px;
}
/* ============================================================
   OYUN-İÇİ HUD — masaüstündeki arcade panelinin KÜÇÜĞÜ (2026-09-17)
   Önce: skor ve rekor çerçevenin altında düz gri metindi; skor sağ alttaki
   dash butonunun, rekor da sol alttaki eğil butonunun ARKASINDA kalıyordu.
   Artık çerçevenin hemen altında tam genişlik ince bir panel (malzemesi
   kit.css'ten gelir: ink kontur + üç ton + pah). Skor solda kahraman,
   rekor yanında sakin bir çip. Dokunmatik butonlar bu panelin ÜSTÜNE
   çıkmaz — bottom değerleri panel yüksekliği kadar yukarı alındı.
   ============================================================ */
body.is-mobile{ --m-hudh:34px; }
@media (prefers-reduced-motion:reduce){
  /* hareket azaltma tercihi (a11y override — !important istisna gerekçeli) */
  body.is-mobile *, body.is-mobile *::before, body.is-mobile *::after{
    animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important;
  }
}
@keyframes specRdy{ 0%,100%{ box-shadow:4px 4px 0 var(--ink), inset 0 4px 0 rgba(255,255,255,.26), inset 0 -4px 0 rgba(0,0,0,.24) }
                    50%{ box-shadow:4px 4px 0 var(--ink), 0 0 0 3px var(--ab-col,#e84d92), inset 0 4px 0 rgba(255,255,255,.3), inset 0 -4px 0 rgba(0,0,0,.24) } }
@media (orientation:landscape){
  /* ============================================================
     DENETİM DÜZELTMELERİ — 2026-09-22  (B: mobil 844x400)
     ------------------------------------------------------------
     Bu blok KATMANSIZ yazıldı. Gerekçe: dokunmatik tuşların konumu
     style.css'in @layer DIŞINDAKİ kuyruğunda (.spec-btn) ve kit.css'te
     (.dash-btn/.duck-btn malzemesi) duruyor; katmanlı bir kural onları
     yenemezdi. `body.is-mobile` öneki (0,2,0) katmansız kit kurallarını
     (0,1,0) spesifiklikle geçer → !important gerekmiyor.
     ============================================================ */
  /* ---------- B2. OYUN-İÇİ DÜZEN: CANVAS ÜSTTE, TUŞLAR ALT ŞERİTTE ----------
     ÖNCE (844x400 ölçümü): canvas y37-319; EĞİL 18,260-82,324 · DASH
     762,260-826,324 · ÖZEL 762,188-826,252 · DURAKLAT 14,14-54,54.
     Dördü de canvas ile kesişiyordu: engellerin girdiği sağ alt köşe ve
     karakterin durduğu sol alt köşe tuşların altında kalıyordu.

     SONRA: sahne üstte ortalı; altında 90px'lik ŞERİT —
     SOL [EĞİL] · ORTA skor plakası · SAĞ [ÖZEL][DASH]. Tuşlar 56px kaide.
     Çerçeve genişliği `calc(100% - 108px)` ile sınırlı: sağda 44px'lik
     duraklat tuşuna temiz bir sütun kalsın (çerçevenin DIŞI). */
  body.is-mobile{ --m-striph:90px; --m-act:56px; }
  body.is-mobile.is-mobile{ padding:6px; }
  /* duraklat: 44px, çerçevenin sağ üst DIŞINDA (sistem tuşlarıyla aynı sütun) */
  body.is-mobile .pause-btn{
    left:auto; right:calc(6px + var(--sa-r));
    top:calc(6px + var(--sa-t));
    width:44px; height:44px; border-radius:var(--k-r-btn-sm,10px);
  }
}
