/* Ash&Dash v7.6 - mobil arayüz düzeni (body.m2 = dokunmatik cihaz + "mobui" özelliği açık) */
i.mi { font-style: normal; }
.hud-top > button .mt { margin-left: 4px; }
#mStack { display: contents; }
#mMenu { display: none; }

/* ---------- ortak ---------- */
body.m2 { --gl: calc(6px + env(safe-area-inset-left)); --gr: calc(6px + env(safe-area-inset-right)); --gt: calc(6px + env(safe-area-inset-top)); --gb: calc(6px + env(safe-area-inset-bottom)); --lw: 184px; }
/* oyuncu çerçevesi: yalnız ad, can, mana, XP */
body.m2 .hud-left { left: var(--gl); top: var(--gt); width: var(--lw); padding: 5px 7px; font-size: 11px; border-radius: 10px; }
body.m2 .hud-left .np, body.m2 .hud-left .npb, body.m2 #hudPrem, body.m2 #hudCls { display: none !important; }
body.m2 .hud-left .name-row { font-size: 12px; margin-bottom: 3px; }
body.m2 .hud-left .bar { height: 11px; margin-bottom: 2px; }
body.m2 .hud-left .bar span { font-size: 9px; line-height: 11px; }
body.m2 .hud-left .bar.xp { height: 4px; margin-bottom: 0; }

/* sol yığın: hasar sıralaması, parti, görev takibi, öldürme akışı */
body.m2 #mStack { display: flex; flex-direction: column; gap: 5px; position: absolute; left: var(--gl); top: calc(var(--gt) + 62px); width: var(--lw); max-height: calc(100% - var(--gt) - 62px - 128px); overflow: hidden; pointer-events: none; z-index: 2; }
body.m2 #mStack > * { position: static !important; transform: none !important; width: auto !important; max-width: none !important; margin: 0 !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; flex: none; pointer-events: auto; }
body.m2 #dmgMeter { padding: 4px 5px; }
body.m2 #dmgMeter .dm-h { font-size: 10px; margin-bottom: 2px; }
body.m2 #dmgMeter .dm-r { height: 14px; line-height: 14px; font-size: 10px; margin-top: 2px; }
body.m2 #dmgMeter .dm-v small { display: none; }
body.m2 #partyFrame { gap: 3px; flex-direction: column !important; }
body.m2 #dmgMeter { order: 0; } body.m2 #partyFrame { order: 1; } body.m2 #tracker { order: 2; } body.m2 #feed { order: 3; }
body.m2 #partyFrame .pm { min-width: 0; padding: 2px 5px; font-size: 10px; display: grid; grid-template-columns: 1fr 44px; align-items: center; gap: 4px; }
body.m2 #partyFrame .pm > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.m2 #partyFrame .pm b { font-size: 11px; }
body.m2 #partyFrame .pm small { font-size: 9px; }
body.m2 #partyFrame .pm .bar.mini { height: 4px; margin: 0; }
body.m2.dm-on #partyFrame .pm small { display: none; }
body.m2 #partyFrame .pf-h { font-size: 10px; }
body.m2 #tracker { text-align: left; }
body.m2 #trackerHead { font-size: 11px; padding: 3px 7px; }
body.m2 #trackerList .tq { padding: 3px 6px; }
body.m2 #trackerList .tq b { font-size: 11px; }
body.m2 #trackerList .tq small { font-size: 9px; }
body.m2 #trackerList .tq:nth-child(n+3) { display: none; }
body.m2.dm-on #trackerList .tq:nth-child(n+2) { display: none; }
body.m2 #feed { font-size: 10px; gap: 2px; }
body.m2 #feed div:nth-child(n+3) { display: none; }

/* üst butonlar: tek satır simge */
body.m2 .hud-top { top: var(--gt); left: 50%; transform: translateX(-50%); max-width: calc(100% - 2 * var(--lw) - 40px); flex-wrap: wrap; gap: 4px; justify-content: center; }
body.m2 .hud-top > button { padding: 0 !important; width: 36px; height: 32px; border-radius: 10px !important; font-size: 16px !important; display: inline-flex; align-items: center; justify-content: center; animation: none; }
body.m2 .hud-top > button .mt { display: none; }
body.m2 #krikuBtn.on { width: auto; padding: 0 8px !important; }
body.m2 #krikuBtn.on .mt { display: inline; font-size: 10px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.m2 #bfBtn { border-width: 2px; }
body.m2 #eventBanner { font-size: 10px; padding: 2px 8px; max-width: 100%; order: 10; flex-basis: 100%; text-align: center; }
body.m2 #inviteBox { order: 11; flex-basis: 100%; }

/* sağ üst: altın, ☰ menü, mini harita */
body.m2 .hud-right { right: var(--gr); top: var(--gt); width: var(--lw); }
body.m2 #hudZone { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.m2 .hud-right .gold { font-size: 12px; }
body.m2 .hud-right .gold span { font-size: 12px; }
body.m2 #minimap { position: absolute; right: 0; top: 38px; width: 104px !important; height: 64px !important; max-width: none; max-height: none; margin: 0; }
body.m2 #hudBuffs { position: absolute; right: 108px; top: 76px; max-width: 76px; justify-content: flex-end; }
body.m2 #hudBuffs span { font-size: 11px; padding: 0 3px; }
body.m2 #mMenu { display: block; position: absolute; right: calc(var(--gr) + 110px); top: calc(var(--gt) + 38px); width: 36px; height: 34px; font-size: 18px; z-index: 6; pointer-events: auto; }
body.m2 .menu-btns { display: none; }
body.m2.m2-menu .menu-btns { display: grid; position: fixed; right: var(--gr); top: calc(var(--gt) + 76px); grid-template-columns: repeat(5, 44px); gap: 6px; max-width: none; padding: 8px; background: rgba(14,10,24,.94); border: 1px solid rgba(255,216,74,.35); border-radius: 12px; box-shadow: 0 10px 30px #000a; z-index: 30; }
body.m2.m2-menu .menu-btns .ib { width: 44px; height: 44px; font-size: 20px; }
body.m2 .menu-btns .rank-row { grid-column: 1 / -1; position: static !important; display: flex; justify-content: stretch; gap: 6px; margin: 2px 0 0; }
body.m2 .menu-btns .rank-row button { flex: 1; position: static !important; margin: 0; padding: 7px 6px; font-size: 12px; }
body.m2 #fsBtn { display: none; }

/* boss / hedef çubuğu ve duyurular: üst ortada, butonların altında */
body.m2 #bossBar, body.m2 #tgtFrame { top: calc(var(--gt) + 64px); width: min(360px, calc(100% - 2 * var(--lw) - 30px)); }
body.m2 #bossBar .boss-name { font-size: 12px; }
body.m2 #bossBar .bar.boss { height: 14px; }
body.m2 #annBox, body.m2 #boostTag { top: calc(var(--gt) + 98px); }
body.m2 #modeTag { left: auto; right: var(--gr); top: calc(var(--gt) + 106px); }
body.m2 #rankUp { top: 30%; }

/* kontroller */
body.m2 #stick { width: 112px; height: 112px; left: calc(14px + env(safe-area-inset-left)); bottom: calc(12px + env(safe-area-inset-bottom)); }
body.m2 #knob { width: 48px; height: 48px; margin: -24px 0 0 -24px; }
body.m2 #tbtns { transform: scale(.86); transform-origin: right bottom; right: calc(6px + env(safe-area-inset-right)); bottom: calc(6px + env(safe-area-inset-bottom)); }

/* sohbet ve bildirimler: alt ortada, joystick ile beceriler arasında */
body.m2 #chatBox { left: calc(140px + env(safe-area-inset-left)); right: auto; transform: none; bottom: var(--gb); width: calc(100% - 140px - 230px - env(safe-area-inset-left) - env(safe-area-inset-right)); max-width: 380px; font-size: 11px; }
body.m2 #chatBox .ch-list { max-height: 50px; }
body.m2 #chatBox.open { left: 50%; transform: translateX(-50%); width: min(520px, 94vw); max-width: none; z-index: 25; bottom: 50%; }
body.m2 #chatBox.open .ch-list { max-height: 30vh; }
body.m2 #navInfo { top: auto; bottom: calc(var(--gb) + 58px); font-size: 11px; }
body.m2 #toasts { top: 30%; }
body.m2 #tutBox { top: auto; bottom: calc(var(--gb) + 66px); left: 50%; transform: translateX(-50%); width: min(300px, 60vw); }
body.m2 #interact { bottom: 46%; }
body.m2 #admBar { top: calc(var(--gt) + 110px); }

/* ---------- dikey telefon ---------- */
@media (orientation: portrait) {
  body.m2 { --lw: min(190px, 49vw); }
  body.m2 .hud-top { top: calc(var(--gt) + 108px); max-width: calc(100% - 12px); flex-wrap: nowrap; }
  body.m2 #bossBar, body.m2 #tgtFrame { top: calc(var(--gt) + 146px); width: calc(100% - 24px); }
  body.m2 #annBox, body.m2 #boostTag { top: calc(var(--gt) + 186px); }
  body.m2 #mStack { top: calc(var(--gt) + 186px); max-height: calc(100% - var(--gt) - 186px - 330px); }
  body.m2 .hud-right { width: auto; max-width: 48vw; }
  body.m2 #minimap { top: 40px; width: 96px !important; height: 60px !important; }
  body.m2 #mMenu { right: calc(var(--gr) + 102px); top: calc(var(--gt) + 40px); }
  body.m2 #hudBuffs { right: 100px; top: 78px; }
  body.m2.m2-menu .menu-btns { top: calc(var(--gt) + 106px); grid-template-columns: repeat(5, 46px); }
  body.m2 #tbtns { transform: scale(.92); }
  body.m2 #chatBox { left: var(--gl); bottom: calc(var(--gb) + 140px); width: calc(100% - 210px - env(safe-area-inset-left)); max-width: 240px; }
  body.m2 #chatBox .ch-list { max-height: 64px; }
  body.m2 #modeTag { top: calc(var(--gt) + 104px); right: auto; left: var(--gl); }
}
body.m2 #tgtFrame .tg-s { display: none; }

/* ---------- v7.8b: sade dokunmatik düzen ----------
   Saldırı köşede; 4 yetenek yakın halkada, 5. yetenek + kaçış/iksir/ustalık/hedef dış halkada, OTO ve konuş en dışta.
   Hepsi ~210 px'lik çeyrek dairede: ekranın ortası açık kalır. --uis: Ayarlar'daki "Düğme boyutu". */
body.m2 #tbtns { position: absolute; right: calc(4px + env(safe-area-inset-right)); bottom: calc(4px + env(safe-area-inset-bottom)); width: 250px; height: 250px; transform: scale(calc(.86 * var(--uis, 1))) !important; transform-origin: right bottom; }
body.m2 .tb { background: #0a081299; border-color: #ffffff33; opacity: .9; }
body.m2 .tb.atk { width: 68px; height: 68px; right: 10px; bottom: 10px; font-size: 28px; }
body.m2 .tb.s1, body.m2 .tb.s2, body.m2 .tb.s3, body.m2 .tb.s4 { width: 44px; height: 44px; font-size: 17px; }
body.m2 .tb.s1 { right: 110px; bottom: 22px; } body.m2 .tb.s2 { right: 98px; bottom: 66px; }
body.m2 .tb.s3 { right: 66px; bottom: 98px; } body.m2 .tb.s4 { right: 22px; bottom: 110px; }
body.m2 .tb.dodge, body.m2 .tb.s5, body.m2 .tb.m6, body.m2 .tb.m7, body.m2 .tb.pot, body.m2 .tb.tgt { width: 42px; height: 42px; font-size: 16px; }
body.m2 .tb.dodge { right: 171px; bottom: 23px; } body.m2 .tb.s5 { right: 164px; bottom: 69px; }
body.m2 .tb.m6 { right: 143px; bottom: 110px; } body.m2 .tb.m7 { right: 110px; bottom: 143px; }
body.m2 .tb.pot { right: 69px; bottom: 164px; } body.m2 .tb.tgt { right: 23px; bottom: 171px; }
body.m2 .tb.auto { width: 40px; height: 40px; right: 222px; bottom: 77px; }
body.m2 .tb.use { width: 44px; height: 44px; right: 77px; bottom: 214px; }
body.m2 .tb.auto small { font-size: 7px; }
/* üst sıra ve duyurular daha küçük */
body.m2 .hud-top > button { width: 32px; height: 28px; font-size: 14px !important; border-radius: 8px !important; }
body.m2 #eventBanner { font-size: 9px; padding: 1px 8px; }
/* sohbet: 2 satır, daha şeffaf, düğmelerin solunda */
body.m2 #chatBox .ch-list { max-height: 36px; }
body.m2 #chatBox .ch-list div { background: #0004; padding: 1px 6px; }
body.m2 #chatBox:not(.open) { opacity: .85; width: calc(100% - 150px - 230px * var(--uis, 1) - env(safe-area-inset-left) - env(safe-area-inset-right)); }
@media (orientation: portrait) {
  body.m2 #tbtns { transform: scale(calc(.95 * var(--uis, 1))) !important; }
  body.m2 #chatBox:not(.open) { left: var(--gl); bottom: calc(var(--gb) + 150px); width: calc(100% - 250px * var(--uis, 1)); max-width: 260px; }
  body.m2 #chatBox .ch-list { max-height: 54px; }
}

/* ---------- v8.2: telefon testinden düzeltmeler ---------- */
/* ☰ menü açıkken joystick, saldırı ve yetenek düğmeleri gizlenir (menünün üstüne binmesin) */
body.m2.m2-menu #tbtns, body.m2.m2-menu #stick { visibility: hidden; }
body.m2.m2-menu .menu-btns { z-index: 30; }
/* Ulusal Savaş / sıradaki etkinlik şeridi: yazı kadar genişlik */
body.m2 #eventBanner { flex: 0 1 auto !important; flex-basis: auto !important; width: auto !important; max-width: 230px !important; display: block !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0 auto; }
/* boss ve hedef can çubuğu daha dar */
body.m2 #bossBar, body.m2 #tgtFrame { width: min(240px, calc(100% - 2 * var(--lw) - 30px)); }
body.m2 #bossBar .bar.boss { height: 10px; } body.m2 #bossBar .bar.boss span { font-size: 8px; line-height: 10px; }
body.m2 #bossBar .boss-name { font-size: 10px; }
/* büyük duyuru yazıları (sezon, seviye) telefonda küçük */
body.m2 .toast.big { font-size: 12px; padding: 5px 12px; max-width: 62vw; }
body.m2 .toast { font-size: 11px; max-width: 62vw; }
body.m2 #toasts { top: 36%; }
body.m2 .toast.big { font-family: inherit; letter-spacing: 0; }
/* eğitim kutusu: düğmelerin üstünde, ekranın ortasında */
body.m2 #tutBox { position: fixed; z-index: 35; top: 30%; bottom: auto; left: 50%; transform: translateX(-50%); width: min(300px, 50vw); }
/* kısa ekran (yatay telefon, adres çubuğu açık): düğme kümesi küçülür, mini haritaya binmez */
@media (max-height: 380px) {
  body.m2 #tbtns { transform: scale(calc(.72 * var(--uis, 1))) !important; }
  body.m2 #stick { width: 96px; height: 96px; }
  body.m2 #chatBox:not(.open) { width: calc(100% - 140px - 200px * var(--uis, 1) - env(safe-area-inset-left) - env(safe-area-inset-right)); }
  body.m2 #mStack { max-height: calc(100% - var(--gt) - 62px - 110px); }
}
/* paneller yatay telefonda: tam yükseklik, envanter iki sütun (karakter solda, çanta sağda) */
@media (max-height: 500px) and (orientation: landscape) {
  #panel { padding: 4px; }
  .panel-box, #panel.wide .panel-box { max-height: calc(100vh - 8px); max-height: calc(100dvh - 8px); width: min(900px, 100%); }
  .panel-head { padding: 6px 12px !important; }
  .inv-wrap { grid-template-columns: 210px 1fr !important; gap: 10px; }
  .inv-left { max-height: calc(100dvh - 70px); overflow-y: auto; }
  .paperdoll { height: 226px !important; }
  .pd-helmet, .pd-neck { top: 4px !important; } .pd-armor, .pd-ear1 { top: 48px !important; } .pd-weapon, .pd-ear2 { top: 92px !important; } .pd-belt, .pd-ring1 { top: 136px !important; } .pd-talisman, .pd-ring2 { top: 180px !important; } .pd .slot { width: 38px !important; height: 38px !important; } .pd small { display: none !important; }
  .inv-right .inv-grid { max-height: none; }
  .kr-grid { grid-template-columns: 1fr 1fr !important; }
}
@media (orientation: portrait) {
  body.m2 #tutBox { top: 38%; width: min(320px, 88vw); }
  body.m2 #bossBar, body.m2 #tgtFrame { width: min(260px, calc(100% - 24px)); }
}
