/* ==========================================================================
   KODAYSONLINE - MOBİL OYUN ARAYÜZÜ
   html.ko-m sınıfı yalnızca dokunmatik cihazlarda / kısa yatay pencerelerde
   eklenir (index.php <head> + mobil.js). Masaüstü görünümüne dokunulmaz.
   Bütün ölçüler --u ile ölçeklenir: 860x400 telefon = 1, küçük telefon ~0.75,
   tablet ~1.2-1.55. Böylece her cihazda aynı yerleşim kendi boyutunda durur.
   ========================================================================== */

html.ko-m {
    --u: 1;
    --px: calc(var(--u) * 1px);
    --sl: max(env(safe-area-inset-left, 0px), calc(var(--px) * 8));
    --sr: max(env(safe-area-inset-right, 0px), calc(var(--px) * 8));
    /* Üst ve alt şeritteki arayüz (karakter çerçevesi, bilgi kartları, sohbet/log) yatay iPhone'da
       güvenli alanın yarısı kadar içeride durur: Dynamic Island yalnız orta yüksekliktedir, köşelerde
       yuvarlak kenar payı yeterlidir. Orta yükseklikteki joystick ve skill grubu tam payı (--sl/--sr) kullanır. */
    --sl-edge: max(calc(env(safe-area-inset-left, 0px) * 0.45), calc(var(--px) * 8));
    --sr-edge: max(calc(env(safe-area-inset-right, 0px) * 0.45), calc(var(--px) * 8));
    /* Ekranın en üst şeridi iOS'ta sistem hareketine ayrılır; üst düğmeler biraz aşağıda durur */
    --st: max(env(safe-area-inset-top, 0px), calc(var(--px) * 10));
    --sb: max(env(safe-area-inset-bottom, 0px), calc(var(--px) * 4));
    /* Alt köşedeki sohbet/log ve savaş ızgarası ev çubuğu payının yarısıyla köşeye oturur */
    --sb-edge: max(calc(env(safe-area-inset-bottom, 0px) * 0.5), calc(var(--px) * 4));

    --kom-info-width: max(132px, calc(var(--px) * 132));
    --kom-gold: #f1cf7e;
    --kom-gold-dim: #a8834a;
    --kom-line: rgba(170, 130, 72, 0.55);
    --kom-panel: rgba(14, 10, 8, 0.82);
    --kom-panel-solid: #120d0b;
    --kom-text: #f3e9d8;
    --kom-muted: #b9a990;

    /* Sağ alt savaş ızgarası: 4 sütun (c4 = saldırı sütunu) x 4 satır.
       r1: sayfa seçici | r2-r4: yuvalar, Z hedef | saldırı c4'te r3-r4. */
    --kom-cell: calc(var(--px) * 43);
    --kom-step: calc(var(--px) * 50);
    --kom-atk: calc(var(--px) * 86);
    --kom-c4: calc(var(--sr-edge) + var(--px) * 2 + var(--kom-atk) / 2);
    --kom-c3: calc(var(--kom-c4) + var(--kom-atk) / 2 + var(--px) * 8 + var(--kom-cell) / 2);
    --kom-c2: calc(var(--kom-c3) + var(--kom-step));
    --kom-c1: calc(var(--kom-c2) + var(--kom-step));
    --kom-r4: calc(var(--sb-edge) + var(--px) * 8 + var(--kom-cell) / 2);
    --kom-r3: calc(var(--kom-r4) + var(--kom-step));
    --kom-r2: calc(var(--kom-r3) + var(--kom-step));
    --kom-r1: calc(var(--kom-r2) + var(--kom-step));
    --kom-atk-r: calc(var(--kom-c4) + var(--px) * 7);
    --kom-atk-b: calc((var(--kom-r4) + var(--kom-r3)) / 2 + var(--px) * 9);
    --kom-skill: var(--kom-cell);
    --kom-row: var(--kom-cell);
}

/* --------------------------------------------------------------------------
   0. TEMEL: tam ekran sahne, seçim/zoom/kaydırma yok
   -------------------------------------------------------------------------- */
html.ko-m,
html.ko-m body.game-page {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html.ko-m .game-stage,
html.ko-m .game-world,
html.ko-m .game-field {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

html.ko-m input,
html.ko-m textarea,
html.ko-m [contenteditable="true"] {
    -webkit-user-select: text;
    user-select: text;
}

/* Kaydırılabilir her alan parmakla kayar */
html.ko-m .side-panel,
html.ko-m .side-panel *,
html.ko-m .ko-chat-lines,
html.ko-m .ko-log-lines,
html.ko-m .kom-hub-grid,
html.ko-m .ko-genie-settings-modal {
    touch-action: pan-x pan-y;
}

html.ko-m [data-gm-hide-target].is-gm-ui-hidden {
    display: none !important;
}

/* Masaüstüne ait ve mobilde yerine yenisi gelen öğeler */
html.ko-m .ko-chat-bottom-row,
html.ko-m .ko-bottom-menu,
html.ko-m .ko-nearby-box,
html.ko-m .ko-hud-community,
html.ko-m .ko-hud-socials,
html.ko-m .ko-minimap,
html.ko-m .ko-server-cards .ko-server-card.is-premium,
html.ko-m .ko-sb-more,
html.ko-m .ko-sb-more-toggle,
html.ko-m .ko-minimap-zoom {
    display: none !important;
}

/* Mobil katman öğeleri masaüstünde hiç görünmez */
.kom-topbar,
.kom-event-btn,
.kom-hub,
.kom-actions,
.kom-camera-control,
.kom-joy-zone,
.kom-chat-btn,
.kom-rotate,
.kom-target-clear,
.kom-portrait,
.kom-hud-class-icon,
.kom-hud-stats {
    display: none;
}

/* Ortak düğme dokusu */
html.ko-m .kom-topbar button,
html.ko-m .kom-actions button,
html.ko-m .kom-camera-control,
html.ko-m .kom-chat-btn,
html.ko-m .kom-hub button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    touch-action: none;
}

/* --------------------------------------------------------------------------
   1. SOL ÜST: KARAKTER ÇERÇEVESİ (yuvarlak portre + HP/MP)
   -------------------------------------------------------------------------- */
html.ko-m .ko-player-hud {
    position: fixed;
    top: var(--st);
    left: var(--sl-edge);
    z-index: 35;
    transform: none;
    filter: none;
    pointer-events: none;
}

html.ko-m .ko-hud-frame-wrap {
    width: calc(var(--px) * 236);
    padding: 0;
    gap: 0;
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
    align-items: flex-start;
}

html.ko-m .ko-hud-class-box {
    position: relative;
    z-index: 2;
    width: calc(var(--px) * 58);
    height: calc(var(--px) * 58);
    border-radius: 50%;
    border: calc(var(--px) * 2) solid var(--kom-gold-dim);
    background: radial-gradient(circle at 50% 30%, #3a2c22, #0b0807 75%);
    box-shadow: 0 0 0 calc(var(--px) * 1) #000, 0 calc(var(--px) * 3) calc(var(--px) * 10) rgba(0, 0, 0, 0.8), inset 0 0 calc(var(--px) * 8) #000;
    overflow: hidden;
}

html.ko-m .ko-hud-class-box img {
    width: 74%;
    height: 74%;
}

html.ko-m .ko-hud-class-box .kom-portrait {
    display: block;
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background-repeat: no-repeat;
    background-size: 230% auto;
    background-position: 50% 4%;
}

html.ko-m .ko-hud-class-box > img {
    display: none;
}

html.ko-m .ko-hud-bars-box {
    height: auto;
    align-self: flex-start;
    margin-left: calc(var(--px) * -10);
    /* İsim + üç çubuk bloğu avatarın dikey ortasına oturur */
    margin-top: calc(var(--px) * 1.5);
    padding: calc(var(--px) * 2) calc(var(--px) * 3) 0 calc(var(--px) * 13);
    gap: calc(var(--px) * 2);
    background: transparent !important;
    border: 0 !important;
    border-radius: 0;
    box-shadow: none !important;
}

html.ko-m .ko-hud-name-row {
    height: calc(var(--px) * 15);
    padding: 0 calc(var(--px) * 2);
    justify-content: flex-start;
    gap: calc(var(--px) * 2);
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
    font-size: calc(var(--px) * 11);
}

html.ko-m .kom-hud-class-icon {
    display: block;
    flex: 0 0 auto;
    width: calc(var(--px) * 14);
    height: calc(var(--px) * 14);
    object-fit: contain;
    filter: drop-shadow(0 1px 2px #000);
}

html.ko-m .ko-hud-name-row b {
    display: none;
}

html.ko-m .ko-hud-name {
    font-size: calc(var(--px) * 11);
    overflow: hidden;
    text-overflow: ellipsis;
}

html.ko-m .ko-hud-bar-row {
    height: calc(var(--px) * 12);
    border-radius: calc(var(--px) * 2);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.8);
}

html.ko-m .ko-hud-bar-row.is-mp {
    height: calc(var(--px) * 9);
}

html.ko-m .ko-hud-bar-text {
    font-size: calc(var(--px) * 9);
}

/* EXP: HP ve MP ile aynı grupta, MP'nin hemen altında */
html.ko-m .ko-hud-bar-row.is-exp {
    position: relative;
    inset: auto;
    z-index: auto;
    height: calc(var(--px) * 9);
    border-radius: calc(var(--px) * 2);
    overflow: hidden;
}

html.ko-m .ko-hud-bar-row.is-exp .ko-hud-bar-text {
    position: relative;
    inset: auto;
    font-size: calc(var(--px) * 8);
    color: #ffe2a0;
}

html.ko-m .ko-hud-bar-row.is-exp .ko-hud-bar-text::before {
    content: 'EXP ';
}

html.ko-m .kom-hud-stats {
    display: flex;
    align-items: center;
    gap: calc(var(--px) * 6);
    min-height: calc(var(--px) * 10);
    padding: 0 calc(var(--px) * 2);
    font: 700 calc(var(--px) * 8) / 1 Tahoma, 'Segoe UI', Arial, sans-serif;
    text-shadow: 0 1px 2px #000, 0 0 3px #000;
    white-space: nowrap;
}

html.ko-m .kom-hud-stats span {
    display: inline-flex;
    align-items: center;
    gap: calc(var(--px) * 2);
    height: calc(var(--px) * 10);
    line-height: calc(var(--px) * 10);
}

html.ko-m .kom-hud-stats b {
    color: #e8ebe3;
    font: inherit;
    line-height: inherit;
}

html.ko-m .kom-hud-stats .is-fps i {
    color: #edf0e8;
    font-style: normal;
    line-height: inherit;
}

html.ko-m .kom-wifi-icon {
    display: inline-block;
    flex: 0 0 auto;
    width: auto;
    height: auto;
    overflow: visible;
    background: none;
    clip-path: none;
    color: #a9afa8;
    font-size: calc(var(--px) * 8.5);
    line-height: 1;
    filter: drop-shadow(0 1px 1px #000);
    transition: color 0.2s ease, filter 0.2s ease;
}

html.ko-m .kom-wifi-icon.is-good,
html.ko-m .kom-hud-stats .is-ms.is-good b {
    color: #66e36f;
}

html.ko-m .kom-wifi-icon.is-medium,
html.ko-m .kom-hud-stats .is-ms.is-medium b {
    color: #ffd34f;
}

html.ko-m .kom-wifi-icon.is-bad,
html.ko-m .kom-hud-stats .is-ms.is-bad b {
    color: #ff5a4f;
}

html.ko-m .kom-wifi-icon.is-good {
    filter: drop-shadow(0 0 calc(var(--px) * 2) rgba(102, 227, 111, 0.55));
}

html.ko-m .kom-wifi-icon.is-medium {
    filter: drop-shadow(0 0 calc(var(--px) * 2) rgba(255, 211, 79, 0.5));
}

html.ko-m .kom-wifi-icon.is-bad {
    filter: drop-shadow(0 0 calc(var(--px) * 2) rgba(255, 90, 79, 0.55));
}

html.ko-m .kom-clock-icon {
    position: relative;
    display: block;
    flex: 0 0 auto;
    width: calc(var(--px) * 8);
    height: calc(var(--px) * 8);
    box-sizing: border-box;
    border: calc(var(--px) * 1) solid #d8d3bd;
    border-radius: 50%;
}

html.ko-m .kom-clock-icon::before,
html.ko-m .kom-clock-icon::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: calc(var(--px) * 1);
    background: #d8d3bd;
    transform-origin: 50% 100%;
}

html.ko-m .kom-clock-icon::before {
    height: calc(var(--px) * 2.5);
    transform: translate(-50%, -100%);
}

html.ko-m .kom-clock-icon::after {
    height: calc(var(--px) * 2);
    transform: translate(-50%, -100%) rotate(120deg);
}

html.ko-m .kom-hud-stats .is-clock b {
    color: #eee9d9;
}

html.ko-m .ko-hud-buff-slots {
    position: fixed;
    top: calc(var(--kom-info-bottom, 112px) + var(--px) * 4);
    right: var(--sr-edge);
    bottom: auto;
    left: auto;
    width: max-content;
    max-width: calc(100vw - var(--sl) - var(--sr) - var(--px) * 300);
    min-height: calc(var(--px) * 30);
    flex-flow: row nowrap;
    justify-content: flex-end;
    align-items: flex-start;
    transform: none;
    z-index: 34;
    margin: 0;
    pointer-events: auto;
}

/* Mobilde kartlar sola doğru büyür; taşıma tutamacı Oto Av tarafında kalır. */
html.ko-m .ko-hud-buff-slots > .ko-buff-card {
    order: 1;
    width: calc(var(--px) * 30);
    height: calc(var(--px) * 30);
    flex-basis: calc(var(--px) * 30);
}

html.ko-m .ko-hud-buff-slots > .buff-drag-handle {
    order: 2;
    flex: 0 0 calc(var(--px) * 10);
    width: calc(var(--px) * 10);
    min-width: calc(var(--px) * 10);
    height: calc(var(--px) * 30);
    min-height: calc(var(--px) * 30);
}

html.ko-m .ko-hud-buff-slots > .ko-buff-card span {
    font-size: calc(var(--px) * 8);
}

/* --------------------------------------------------------------------------
   2. ÜST ORTA: HEDEF ÇERÇEVESİ
   -------------------------------------------------------------------------- */
html.ko-m .target-frame {
    top: var(--st);
    width: calc(var(--px) * 230);
    max-width: 44vw;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    box-shadow: none !important;
    pointer-events: auto;
    z-index: 36;
}

html.ko-m .target-head {
    display: flex !important;
    align-items: center;
    gap: calc(var(--px) * 2);
    margin-bottom: calc(var(--px) * 3);
}

html.ko-m .target-head > b {
    flex: 1 1 auto;
    min-width: 0;
    font-size: calc(var(--px) * 11.5);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 2px #000, 0 0 4px #000, 0 0 6px #000;
}

html.ko-m .target-head button {
    flex: 0 0 auto;
    width: calc(var(--px) * 24);
    height: calc(var(--px) * 24);
    display: grid;
    place-items: center;
    filter: drop-shadow(0 1px 2px #000);
}

html.ko-m .target-head button img {
    width: 80%;
    height: 80%;
}

html.ko-m .target-hp {
    height: calc(var(--px) * 13);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

html.ko-m .target-hp span {
    font-size: calc(var(--px) * 9);
    line-height: calc(var(--px) * 11);
}

/* Ayrı X düğmesi gösterilmez: drop listesi açılınca çanta ikonunun kendisi X olur */
html.ko-m .target-head .kom-target-clear {
    display: none !important;
}

html.ko-m .target-head [data-target-drops].is-open img {
    content: url("/assets/ui/baslik/x-close.png");
    object-fit: contain;
    transform: scale(0.82);
}

html.ko-m .target-head .kom-target-clear img {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

/* Görev takibi solda sohbetin altında, ganimetler alt ortada buff'ların üstünde.
   Ortak kutu (hud-feed) mobilde çözülür; ikisi ayrı yerleşir ve dokunuşu engellemez. */
html.ko-m .hud-feed {
    display: contents;
}

html.ko-m .hud-feed .quest-tracker {
    position: fixed;
    left: calc(var(--sl-edge) + var(--px) * 38);
    top: calc(var(--kom-player-stats-bottom, calc(var(--st) + var(--px) * 88)) + var(--px) * 5);
    transform: none;
    z-index: 33;
    min-width: 0;
    width: calc(var(--px) * 180);
    display: flex;
    flex-direction: column;
    gap: calc(var(--px) * 2);
    pointer-events: none;
}

html.ko-m .hud-feed .quest-tracker[hidden] {
    display: none;
}

html.ko-m .quest-tracker .quest-track-card {
    min-width: 0 !important;
    min-height: 0 !important;
    width: 100%;
    box-sizing: border-box;
    gap: calc(var(--px) * 4) !important;
    padding: calc(var(--px) * 2) calc(var(--px) * 4) calc(var(--px) * 2) calc(var(--px) * 2) !important;
    border: 0 !important;
    border-radius: calc(var(--px) * 5) !important;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)) !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

html.ko-m .quest-tracker .quest-track-pic {
    flex: 0 0 calc(var(--px) * 20) !important;
    width: calc(var(--px) * 20) !important;
    height: calc(var(--px) * 20) !important;
}

html.ko-m .quest-tracker .quest-track-title {
    font-size: calc(var(--px) * 8.5) !important;
    line-height: 1.2 !important;
    text-shadow: 0 1px 2px #000;
}

html.ko-m .quest-tracker .quest-track-body {
    flex: 1 1 auto;
    min-width: 0;
    gap: calc(var(--px) * 2) !important;
}

html.ko-m .quest-tracker .quest-prog-bar {
    width: 100% !important;
    min-width: 0 !important;
    height: calc(var(--px) * 9) !important;
    min-height: 0 !important;
}

html.ko-m .quest-tracker .quest-prog-label {
    font-size: calc(var(--px) * 7.5) !important;
    line-height: calc(var(--px) * 9) !important;
}

html.ko-m .hud-feed .gain-cards {
    position: fixed;
    left: 50%;
    bottom: calc(var(--sb) + var(--px) * 50);
    transform: translateX(-50%);
    z-index: 34;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(var(--px) * 1);
    pointer-events: none;
}

html.ko-m .hud-feed .gain-cards .use-card {
    font-size: calc(var(--px) * 12);
}

html.ko-m.ko-m-panel .hud-feed .quest-tracker,
html.ko-m.ko-m-chat .hud-feed .quest-tracker {
    visibility: hidden;
}

/* --------------------------------------------------------------------------
   3. ÜST MENÜ + SAĞ ÜST OTOMATİK AV VE KONUM BİLGİSİ
   -------------------------------------------------------------------------- */
html.ko-m .kom-topbar {
    display: flex;
    align-items: flex-start;
    position: fixed;
    top: calc(var(--st) + var(--px) * 26);
    left: calc(var(--sl-edge) + var(--px) * 240);
    right: auto;
    z-index: 40;
}

html.ko-m.ko-m-hub .kom-topbar {
    z-index: 102;
}

html.ko-m .kom-top-btn {
    position: relative;
    width: calc(var(--px) * 46);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(var(--px) * 1);
    border: 0;
    background: none;
    transition: transform 0.08s ease;
}

html.ko-m .kom-top-btn img {
    width: calc(var(--px) * 36);
    height: calc(var(--px) * 36);
    object-fit: contain;
    padding: calc(var(--px) * 4);
    box-sizing: border-box;
    border-radius: calc(var(--px) * 9);
    background: radial-gradient(circle at 50% 35%, rgba(70, 48, 32, 0.92), rgba(16, 11, 9, 0.92) 72%);
    border: 1px solid var(--kom-line);
    box-shadow: 0 calc(var(--px) * 2) calc(var(--px) * 6) rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 220, 160, 0.14);
}

html.ko-m .kom-top-btn.is-wide {
    width: calc(var(--px) * 58);
}

html.ko-m .kom-top-btn.is-wide img {
    width: calc(var(--px) * 58);
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    filter: drop-shadow(0 calc(var(--px) * 2) calc(var(--px) * 4) rgba(0, 0, 0, 0.85));
}

html.ko-m .kom-top-btn span:not(.kom-badge) {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    font: 700 calc(var(--px) * 8) / 1.15 Tahoma, 'Segoe UI', Arial, sans-serif;
    letter-spacing: -0.01em;
    color: var(--kom-text);
    text-shadow: 0 1px 2px #000, 0 0 3px #000;
    white-space: nowrap;
}

/* Etkinlik: üst menüden ayrı, Menü düğmesinin hemen altında */
html.ko-m .kom-event-btn {
    display: flex;
    position: fixed;
    top: calc(var(--st) + var(--px) * 68);
    left: calc(var(--sl-edge) + var(--px) * 240);
    right: auto;
    z-index: 40;
    width: calc(var(--px) * 37);
    height: calc(var(--px) * 42);
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: calc(var(--px) * 1);
    border: 0;
    background: none;
}

html.ko-m .kom-event-btn img {
    width: calc(var(--px) * 27);
    height: calc(var(--px) * 27);
    object-fit: contain;
    filter: drop-shadow(0 calc(var(--px) * 2) calc(var(--px) * 4) rgba(0, 0, 0, 0.85));
}

html.ko-m .kom-event-btn span:not(.kom-badge) {
    font: 700 calc(var(--px) * 6.5) / 1 Tahoma, 'Segoe UI', Arial, sans-serif;
    color: var(--kom-text);
    text-shadow: 0 1px 2px #000, 0 0 3px #000;
    white-space: nowrap;
}

html.ko-m .kom-event-btn.is-pressed {
    transform: scale(0.92);
}

html.ko-m.ko-m-genie .kom-event-btn,
html.ko-m.ko-m-chat .kom-event-btn {
    visibility: hidden;
}

html.ko-m .kom-top-btn.is-pressed,
html.ko-m .kom-top-btn:active {
    transform: scale(0.92);
}

html.ko-m .kom-badge {
    position: absolute;
    top: calc(var(--px) * -3);
    right: calc(var(--px) * 0);
    min-width: calc(var(--px) * 15);
    height: calc(var(--px) * 15);
    padding: 0 calc(var(--px) * 3);
    box-sizing: border-box;
    border-radius: calc(var(--px) * 8);
    background: #c62a1d;
    border: 1px solid #ffb08a;
    color: #fff;
    font: 800 calc(var(--px) * 9) / calc(var(--px) * 13) Tahoma, Arial, sans-serif;
    text-align: center;
    pointer-events: none;
}

html.ko-m .ko-top-right-wrap {
    position: fixed;
    top: auto;
    right: 0;
    left: auto;
    bottom: auto;
    z-index: 34;
    transform: none;
    filter: none;
    width: 0;
    height: 0;
    gap: 0;
}

html.ko-m .ko-minimap {
    position: fixed;
    top: var(--st);
    right: var(--sr-edge);
    left: auto;
    bottom: auto;
    width: calc(var(--px) * 112);
    height: calc(var(--px) * 112);
    z-index: 35;
    transform: none;
    margin: 0;
}

html.ko-m .ko-minimap-dial {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    border-width: calc(var(--px) * 3);
    border-color: #8a6a3c;
    box-shadow: 0 0 0 1px #000, 0 calc(var(--px) * 4) calc(var(--px) * 12) rgba(0, 0, 0, 0.75);
}

html.ko-m .ko-minimap-dial canvas {
    width: 100%;
    height: 100%;
}

html.ko-m .ko-server-cards {
    position: fixed;
    /* Avatarın üst çizgisiyle aynı hizada */
    top: var(--st);
    right: var(--sr-edge);
    width: var(--kom-info-width);
    min-width: 0;
    max-width: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 0;
    transform: none;
    pointer-events: none;
}

html.ko-m .ko-server-cards .ko-genie {
    width: 100%;
    margin: 0;
    pointer-events: auto;
}

html.ko-m .ko-server-cards .ko-genie-head {
    height: calc(var(--px) * 19);
    padding-left: calc(var(--px) * 5);
}

html.ko-m .ko-server-cards .ko-genie-title {
    font-size: calc(var(--px) * 9.5);
}

html.ko-m .ko-server-cards .ko-genie-btn,
html.ko-m .ko-server-cards .ko-genie-btn.is-stop,
html.ko-m .ko-server-cards .ko-genie-btn.is-menu {
    width: calc(var(--px) * 16);
    height: calc(var(--px) * 16);
}

html.ko-m .ko-server-cards .ko-genie-btn img,
html.ko-m .ko-server-cards .ko-genie-mini img {
    width: calc(var(--px) * 9);
    height: calc(var(--px) * 9);
}

html.ko-m .ko-server-cards .ko-genie-row {
    min-height: calc(var(--px) * 16);
    font-size: calc(var(--px) * 8.5);
}

html.ko-m .ko-server-cards .ko-genie-row.is-time span {
    font-size: calc(var(--px) * 8.5);
    line-height: calc(var(--px) * 11);
}

html.ko-m .ko-server-cards .ko-genie-mini {
    width: calc(var(--px) * 15);
    height: calc(var(--px) * 15);
}

html.ko-m .kom-top-btn.is-menu img {
    width: calc(var(--px) * 27);
    height: calc(var(--px) * 27);
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    filter: drop-shadow(0 calc(var(--px) * 2) calc(var(--px) * 3) rgba(0, 0, 0, 0.9));
}

html.ko-m .kom-top-btn.is-menu {
    width: calc(var(--px) * 34);
}

html.ko-m .kom-top-btn.is-menu span:not(.kom-badge) {
    font-size: calc(var(--px) * 7);
}

html.ko-m .ko-server-cards .ko-server-card.is-info {
    width: 100%;
    height: calc(var(--px) * 18);
    min-width: 0;
    max-width: 100%;
    margin: 0;
}

html.ko-m .ko-server-cards .ko-card-text {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: calc(var(--px) * 9);
}

/* Otomatik av ayar penceresi: ekranın ortasında */
html.ko-m .ko-genie-settings-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    width: min(calc(var(--px) * 380), 92vw);
    max-height: 88vh;
    overflow-y: auto;
    z-index: 95;
    pointer-events: auto;
}

/* --------------------------------------------------------------------------
   4. SOL ALT: MASAÜSTÜ SOHBET + LOG AKIŞININ MOBİL ÖLÇÜSÜ
   -------------------------------------------------------------------------- */
html.ko-m .kom-chat-btn {
    display: none !important;
}

html.ko-m .ko-chat-zone {
    position: fixed;
    left: var(--sl-edge);
    right: auto;
    top: auto;
    bottom: var(--sb-edge);
    width: min(calc(var(--px) * 190), 23vw);
    max-width: none;
    z-index: 33;
    gap: calc(var(--px) * 2);
    margin: 0;
    transform: none;
    pointer-events: auto;
}

/* Fısıltı kartları: log kutusunun hemen sağında, üst kenarıyla aynı hizada.
   Yığın sohbet bölgesinin içinde durur; sol konumu log bölgesinin genişliği kadar ötelenir.
   Masaüstündeki sürükleyip bırakma konumu (is-free) mobilde geçersizdir. */
html.ko-m .ko-whisper-stack,
html.ko-m .ko-whisper-stack.is-free {
    position: absolute !important;
    left: calc(100% + var(--px) * 9 + min(calc(var(--px) * 150), 18vw)) !important;
    top: 0 !important;
    right: auto !important;
    bottom: auto !important;
    width: auto !important;
    margin: 0 !important;
    gap: calc(var(--px) * 2);
    z-index: 34;
}

html.ko-m .ko-whisper-card {
    width: calc(var(--px) * 92);
    height: calc(var(--px) * 16);
    padding-left: calc(var(--px) * 3);
    font-size: calc(var(--px) * 7.5);
    line-height: calc(var(--px) * 16);
}

html.ko-m .ko-whisper-card .ko-name-icon {
    width: calc(var(--px) * 10);
    height: calc(var(--px) * 10);
}

html.ko-m .ko-whisper-card button {
    width: calc(var(--px) * 16);
    height: calc(var(--px) * 14);
    min-width: 0;
    min-height: 0;
}

html.ko-m .ko-whisper-card button img {
    width: calc(var(--px) * 12);
    height: calc(var(--px) * 12);
}

/* Açılan konuşma: kartların sağında, sohbet kutusuyla aynı hizada ve boyda; sağdaki skill
   düğmelerine binmeyecek genişlikte. Kart sarmalayıcısı konumsuz kalır; pencere yığına göre yerleşir. */
html.ko-m .ko-whisper-item {
    position: static;
}

html.ko-m .ko-whisper-panel {
    left: calc(100% + var(--px) * 4);
    top: 0;
    bottom: auto;
    width: calc(var(--px) * 138);
    box-sizing: border-box;
    overflow: hidden;
    height: calc(var(--px) * 88);
    display: flex;
    flex-direction: column;
}

html.ko-m .ko-whisper-panel[hidden] {
    display: none;
}

html.ko-m .ko-whisper-panel header {
    flex: 0 0 auto;
    height: calc(var(--px) * 16);
    font-size: calc(var(--px) * 7.5);
}

html.ko-m .ko-whisper-panel header button {
    width: calc(var(--px) * 14);
    height: calc(var(--px) * 14);
    min-width: 0;
    min-height: 0;
    line-height: calc(var(--px) * 14);
}

html.ko-m .ko-whisper-lines {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    padding: calc(var(--px) * 3) calc(var(--px) * 4);
    font-size: calc(var(--px) * 7.25);
}

html.ko-m .ko-whisper-panel form {
    flex: 0 0 auto;
    width: 100%;
    height: calc(var(--px) * 20);
    margin: 0;
    padding: calc(var(--px) * 2) calc(var(--px) * 3);
    box-sizing: border-box;
}

/* Mesaj kutusu pencereden taşmaz: genel mobil input ölçüleri burada geçersiz */
html.ko-m .ko-whisper-panel input {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 calc(var(--px) * 3) !important;
    box-sizing: border-box !important;
    font-size: calc(var(--px) * 8);
}

html.ko-m .ko-chat-boxes-row {
    display: block;
    width: 100%;
    height: calc(var(--px) * 88);
    margin: 0;
}

html.ko-m .ko-chat-box {
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 100%;
    margin: 0;
    border: 1px solid #4e3d37;
    border-radius: 0;
    background: rgba(10, 8, 8, 0.92);
    box-shadow: inset 0 0 0 1px #261918, 0 calc(var(--px) * 3) calc(var(--px) * 9) rgba(0, 0, 0, 0.68);
}

html.ko-m .ko-chat-flow,
html.ko-m .ko-log-flow {
    padding: calc(var(--px) * 4);
}

html.ko-m .ko-chat-lines,
html.ko-m .ko-log-lines {
    padding: 0;
    overflow-y: auto;
    font-size: calc(var(--px) * 7.25);
    line-height: calc(var(--px) * 9.25);
    -webkit-mask-image: none;
    mask-image: none;
    -webkit-overflow-scrolling: touch;
}

html.ko-m .ko-chat-lines *,
html.ko-m .ko-log-lines * {
    font-size: inherit;
}

html.ko-m .ko-chat-input-form {
    display: flex;
    height: calc(var(--px) * 18);
    margin-top: calc(var(--px) * 2);
}

html.ko-m .ko-chat-input-form input {
    height: 100%;
    padding: 0 calc(var(--px) * 3);
    font-size: calc(var(--px) * 8);
}

html.ko-m .ko-chat-tabs-row {
    display: flex;
    width: 100%;
    height: calc(var(--px) * 16);
    gap: calc(var(--px) * 2);
}

html.ko-m .ko-player-tabs-group,
html.ko-m .ko-location-menu {
    display: none !important;
}

html.ko-m .ko-channel-tabs-group {
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 100%;
}

html.ko-m .ko-channel-tabs-group .ko-tab-btn,
html.ko-m .ko-log-tabs .ko-tab-btn {
    height: calc(var(--px) * 16);
    padding: 0 calc(var(--px) * 3);
    font-size: calc(var(--px) * 7.25);
    line-height: calc(var(--px) * 14);
}

html.ko-m .ko-chat-bar,
html.ko-m .ko-log-bar {
    display: none !important;
}

html.ko-m .ko-scroll-arrow {
    width: calc(var(--px) * 12);
    height: calc(var(--px) * 10);
    font-size: calc(var(--px) * 7);
}

html.ko-m .ko-log-zone {
    position: fixed;
    left: calc(var(--sl-edge) + min(calc(var(--px) * 190), 23vw) + var(--px) * 5);
    right: auto;
    bottom: var(--sb-edge);
    width: min(calc(var(--px) * 150), 18vw);
    z-index: 33;
    gap: calc(var(--px) * 2);
    margin: 0;
}

html.ko-m .ko-log-main {
    width: 100%;
    height: calc(var(--px) * 88);
}

html.ko-m .ko-log-tabs {
    width: 100%;
    height: calc(var(--px) * 16);
    gap: calc(var(--px) * 2);
}

html.ko-m .ko-log-tabs .ko-lock-btn {
    width: calc(var(--px) * 16);
    height: calc(var(--px) * 16);
}

html.ko-m .kom-chatlog-toggle .ko-lock-icon {
    display: none;
}

html.ko-m .kom-chatlog-toggle::before {
    content: '▼';
    color: #d29a83;
    font: 900 calc(var(--px) * 8) / 1 Tahoma, Arial, sans-serif;
    text-shadow: 0 1px 2px #000;
}

html.ko-m.ko-m-chatlog-collapsed .kom-chatlog-toggle::before {
    content: '▲';
}

html.ko-m.ko-m-chatlog-collapsed .ko-chat-zone,
html.ko-m.ko-m-chatlog-collapsed .ko-log-main,
html.ko-m.ko-m-chatlog-collapsed .ko-log-tabs .ko-tab-btn {
    display: none !important;
}

html.ko-m.ko-m-chatlog-collapsed .ko-log-zone {
    left: var(--sl-edge);
    width: calc(var(--px) * 18);
}

html.ko-m.ko-m-chatlog-collapsed .ko-log-tabs {
    width: calc(var(--px) * 18);
    height: calc(var(--px) * 18);
}

html.ko-m.ko-m-chatlog-collapsed .ko-log-tabs .kom-chatlog-toggle {
    width: calc(var(--px) * 18);
    height: calc(var(--px) * 18);
    margin: 0;
}

html.ko-m .ko-log-tabs [data-log-tab="status"],
html.ko-m .ko-log-tabs [data-log-tab="item"] {
    display: none !important;
}

/* Harita bossu takibi: hedef HP arayüzünün hemen sağında */
html.ko-m .map-boss-tracker {
    position: fixed !important;
    left: auto !important;
    right: calc(var(--sr-edge) + var(--kom-info-width) + var(--px) * 3) !important;
    top: var(--st) !important;
    bottom: auto !important;
    width: var(--kom-info-width);
    max-width: var(--kom-info-width);
    max-height: 28vh;
    overflow-y: auto;
    box-sizing: border-box;
    margin: 0;
    padding: calc(var(--px) * 4) calc(var(--px) * 5);
    border: 0;
    border-radius: 0;
    background: rgba(0, 0, 0, 0.47);
    box-shadow: none;
    font-size: calc(var(--px) * 8);
    z-index: 33;
    pointer-events: auto;
    touch-action: pan-y;
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
}

html.ko-m .map-boss-tracker header {
    min-height: calc(var(--px) * 14);
    gap: calc(var(--px) * 3);
}

html.ko-m .map-boss-tracker header b {
    min-width: 0;
    overflow: hidden;
    font-size: calc(var(--px) * 8.5);
    text-overflow: ellipsis;
    white-space: nowrap;
}

html.ko-m .map-boss-tracker time {
    flex: 0 0 auto;
    font-size: calc(var(--px) * 7.5);
}

html.ko-m .map-boss-tracker .boss-hp {
    height: calc(var(--px) * 10);
    margin: calc(var(--px) * 3) 0 calc(var(--px) * 2);
}

html.ko-m .map-boss-tracker .boss-hp span {
    font-size: calc(var(--px) * 7.5);
    line-height: calc(var(--px) * 10);
}

html.ko-m .map-boss-tracker header button {
    width: calc(var(--px) * 14);
    height: calc(var(--px) * 14);
    min-width: calc(var(--px) * 14);
    font-size: calc(var(--px) * 8);
}

html.ko-m .map-boss-ranking {
    margin-top: calc(var(--px) * 2);
    font-size: calc(var(--px) * 7.5);
}

html.ko-m .map-boss-ranking th,
html.ko-m .map-boss-ranking td {
    padding: calc(var(--px) * 1.5) calc(var(--px) * 2);
}

html.ko-m .map-boss-ranking td:nth-child(2) {
    max-width: calc(var(--px) * 64);
}

html.ko-m.ko-m-panel .map-boss-tracker,
html.ko-m.ko-m-chat .map-boss-tracker {
    visibility: hidden;
}

html.ko-m .map-boss-modal {
    max-height: 90vh;
}

/* GM girişi mobilde açılır oyun menüsünün içinde gösterilir. */
html.ko-m .ko-gm-admin-entry {
    display: none !important;
}

html.ko-m .ko-gm-admin-entry img {
    width: 64%;
    height: 64%;
}

/* --------------------------------------------------------------------------
   5. SAĞ ALT: SALDIRI + BECERİ YAYI, ALT ORTA: HIZLI YUVALAR
   -------------------------------------------------------------------------- */
html.ko-m .kom-actions {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 38;
    pointer-events: none;
}

html.ko-m .kom-actions > button {
    position: absolute;
    pointer-events: auto;
    transform: translate(50%, 50%);
    transition: transform 0.08s ease, filter 0.08s ease;
}

html.ko-m .kom-actions > button.is-pressed {
    transform: translate(50%, 50%) scale(0.9);
    filter: brightness(1.25);
}

html.ko-m .kom-attack {
    right: var(--kom-atk-r);
    bottom: var(--kom-atk-b);
    width: var(--kom-atk);
    height: var(--kom-atk);
    display: grid;
    place-items: center;
    border-radius: 50%;
    z-index: 2;
    border: calc(var(--px) * 2) solid #4a3925;
    background:
        radial-gradient(circle at 38% 30%, rgba(92, 72, 43, 0.72), transparent 38%),
        radial-gradient(circle at 52% 65%, #29251e 0%, #171512 66%, #090807 100%);
    box-shadow:
        0 0 0 calc(var(--px) * 1) #2b251e,
        0 calc(var(--px) * 4) calc(var(--px) * 11) rgba(0, 0, 0, 0.72),
        inset 0 0 calc(var(--px) * 7) rgba(255, 217, 120, 0.16);
}

html.ko-m .kom-attack img {
    width: 64%;
    height: 64%;
    object-fit: contain;
    filter: drop-shadow(0 calc(var(--px) * 2) calc(var(--px) * 2) rgba(0, 0, 0, 0.9));
    pointer-events: none;
}

html.ko-m .kom-round {
    width: var(--kom-cell);
    height: var(--kom-cell);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: calc(var(--px) * 2) solid var(--kom-gold-dim);
    background: radial-gradient(circle at 40% 32%, #4a3a2c 0%, #1d1510 70%);
    box-shadow: 0 calc(var(--px) * 3) calc(var(--px) * 8) rgba(0, 0, 0, 0.7);
    color: var(--kom-text);
}

html.ko-m .kom-round b {
    font: 900 calc(var(--px) * 13) / 1 Tahoma, Arial, sans-serif;
    text-shadow: 0 1px 2px #000;
}

html.ko-m .kom-round small {
    font: 700 calc(var(--px) * 7.5) / 1.1 Tahoma, Arial, sans-serif;
    color: var(--kom-muted);
    letter-spacing: 0.02em;
}

html.ko-m .kom-target small {
    text-transform: uppercase;
}

/* Hedef (Z): sayfa seçicinin altında */
html.ko-m .kom-target {
    right: calc(var(--sr-edge) + var(--px) * 23);
    bottom: calc(var(--sb-edge) + var(--px) * 26);
    width: calc(var(--px) * 50);
    height: calc(var(--px) * 50);
    z-index: 3;
    border: calc(var(--px) * 2) solid #4a3925;
    background:
        radial-gradient(circle at 38% 30%, rgba(95, 73, 42, 0.68), transparent 38%),
        radial-gradient(circle at 52% 66%, #29251f 0%, #171512 68%, #090807 100%);
    box-shadow:
        0 0 0 calc(var(--px) * 1) #2b251e,
        0 calc(var(--px) * 3) calc(var(--px) * 8) rgba(0, 0, 0, 0.75),
        inset 0 0 calc(var(--px) * 5) rgba(255, 217, 120, 0.14);
}

html.ko-m .kom-target img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 calc(var(--px) * 2) calc(var(--px) * 2) rgba(0, 0, 0, 0.85));
}

/* Kamera açısı: sağ başparmakla sürüklenebilen bağımsız kontrol. */
html.ko-m .kom-camera-control {
    position: fixed;
    right: calc(var(--kom-c1) + var(--kom-cell) / 2 + var(--px) * 8);
    bottom: calc(var(--kom-r1) + var(--kom-cell) / 2 + var(--px) * 10);
    z-index: 39;
    width: calc(var(--px) * 38);
    height: calc(var(--px) * 38);
    display: grid;
    place-items: center;
    padding: 0;
    border: calc(var(--px) * 2) solid #4a3925;
    border-radius: 50%;
    background:
        radial-gradient(circle at 38% 30%, rgba(95, 73, 42, 0.68), transparent 38%),
        radial-gradient(circle at 52% 66%, #29251f 0%, #171512 68%, #090807 100%);
    box-shadow:
        0 0 0 calc(var(--px) * 1) #2b251e,
        0 calc(var(--px) * 3) calc(var(--px) * 8) rgba(0, 0, 0, 0.75),
        inset 0 0 calc(var(--px) * 5) rgba(255, 217, 120, 0.14);
    touch-action: none;
    user-select: none;
}

html.ko-m .kom-camera-control img {
    width: 68%;
    height: 68%;
    object-fit: contain;
    pointer-events: none;
    filter: sepia(0.75) saturate(1.25) brightness(1.15)
        drop-shadow(0 calc(var(--px) * 2) calc(var(--px) * 2) rgba(0, 0, 0, 0.85));
}

html.ko-m .kom-camera-control.is-active:not(.is-repositioning) {
    border-color: #d3aa61;
    filter: brightness(1.18);
    transform: scale(0.92);
}

html.ko-m .kom-camera-control.is-repositioning {
    border-color: #ffe09a;
    transform: none;
    filter: brightness(1.2);
    box-shadow:
        0 0 calc(var(--px) * 12) rgba(255, 217, 120, 0.58),
        inset 0 0 calc(var(--px) * 6) rgba(255, 217, 120, 0.2);
    cursor: grabbing;
}


/* Savaş ızgarasının üstünde sayfa seçici: [‹ Sayfa ›] */
html.ko-m .kom-ctrl {
    position: absolute;
    right: calc(var(--kom-atk-r) - var(--px) * 41);
    bottom: calc(var(--kom-atk-b) + var(--kom-atk) / 2 + var(--px));
    width: calc(var(--px) * 82);
    height: var(--kom-cell);
    display: flex;
    align-items: stretch;
    pointer-events: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

html.ko-m .kom-ctrl > * + * {
    border-left: 0 !important;
}

/* Sayfa seçici (oyunun kendi düğmeleri, çubuğa taşınır) */
html.ko-m .kom-ctrl .ko-sb-pager {
    position: static !important;
    transform: none !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start;
    justify-content: space-between;
    gap: calc(var(--px) * 2);
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0;
    border-radius: 0;
    background: none !important;
    box-shadow: none !important;
}

html.ko-m .kom-ctrl .ko-sb-page-arrow {
    flex: 0 0 auto;
    width: calc(var(--px) * 34) !important;
    height: calc(var(--px) * 34) !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 1px solid #4a3925 !important;
    border-radius: 50% !important;
    background:
        radial-gradient(circle at 38% 30%, rgba(75, 59, 38, 0.52), transparent 40%),
        linear-gradient(180deg, rgba(35, 29, 22, 0.97), rgba(12, 10, 8, 0.96)) !important;
    box-shadow:
        0 calc(var(--px) * 2) calc(var(--px) * 6) rgba(0, 0, 0, 0.65),
        inset 0 1px 0 rgba(255, 217, 120, 0.1) !important;
    color: #ffd978 !important;
    font-size: calc(var(--px) * 12) !important;
    line-height: 1 !important;
    transform: none !important;
    touch-action: manipulation;
}

html.ko-m .kom-ctrl .ko-sb-page-arrow:active {
    border-color: #ffd978 !important;
    filter: brightness(1.18);
}

html.ko-m .kom-ctrl .ko-sb-page-num {
    min-width: calc(var(--px) * 8);
    height: calc(var(--px) * 34);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font: 800 calc(var(--px) * 14) / 1 Tahoma, Arial, sans-serif !important;
    color: #e8dfcd !important;
    text-shadow: 0 1px 2px #000;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* OTO ve ayar: çubuğun içinde, kare değil bölüm */
html.ko-m .kom-ctrl .kom-auto,
html.ko-m .kom-ctrl .kom-auto-set {
    position: static !important;
    transform: none !important;
    height: 100%;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: var(--kom-text);
    touch-action: none;
}

html.ko-m .kom-ctrl .kom-auto {
    width: calc(var(--px) * 58);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: calc(var(--px) * 2);
}

html.ko-m .kom-ctrl .kom-auto b {
    display: block;
    text-align: center;
    font: 900 calc(var(--px) * 12) / 1.05 Tahoma, Arial, sans-serif;
    letter-spacing: 0.04em;
    color: #e8dfcd;
    text-shadow: 0 1px 2px #000;
}

html.ko-m .kom-ctrl .kom-auto small {
    font: 700 calc(var(--px) * 8) / 1 Tahoma, Arial, sans-serif;
    color: #d8cfbe;
}

/* OTO + ayar tek düğme: kapalıyken koyu, açıkken bütün düğme yeşil yanar */
html.ko-m .kom-ctrl .kom-auto-group {
    display: flex;
    align-items: stretch;
    transition: background 0.18s ease;
}

html.ko-m .kom-ctrl .kom-auto-group.is-on {
    background: #14521c;
    box-shadow: inset 0 0 calc(var(--px) * 5) rgba(85, 220, 92, 0.35);
}

html.ko-m .kom-ctrl .kom-auto-group .kom-auto-set {
    width: calc(var(--px) * 34) !important;
    border-left: 1px solid #2b251e !important;
}

html.ko-m .kom-ctrl .kom-auto-group.is-on .kom-auto-set {
    border-left-color: #3d3325 !important;
}

html.ko-m .kom-ctrl .kom-auto-group .kom-auto-set img {
    width: calc(var(--px) * 17);
    height: calc(var(--px) * 17);
    opacity: 0.9;
}

html.ko-m .kom-ctrl .kom-auto.is-on {
    background: none;
}

html.ko-m .kom-ctrl .kom-auto.is-on b {
    color: #ffffff;
}

html.ko-m .kom-ctrl .kom-auto.is-on small {
    color: #d4f7d4;
}

html.ko-m .kom-ctrl .kom-auto-set {
    width: calc(var(--px) * 42);
    display: grid;
    place-items: center;
}

html.ko-m .kom-ctrl .kom-auto-set img {
    width: calc(var(--px) * 20);
    height: calc(var(--px) * 20);
    object-fit: contain;
}

html.ko-m .kom-ctrl button.is-pressed {
    background: #191613 !important;
}

html.ko-m .kom-auto small:empty {
    display: none;
}

html.ko-m .kom-auto.is-on {
    border-color: #7fe08a;
    background: radial-gradient(circle at 40% 32%, #2f8a3c 0%, #103a17 72%);
    box-shadow: 0 0 calc(var(--px) * 12) rgba(110, 230, 120, 0.55), 0 calc(var(--px) * 3) calc(var(--px) * 8) rgba(0, 0, 0, 0.7);
}

html.ko-m .kom-auto.is-on b {
    color: #d9ffd9;
}

html.ko-m .kom-mini {
    border-width: calc(var(--px) * 2) !important;
    background: radial-gradient(circle at 40% 32%, #4a3a2c 0%, #1d1510 70%) !important;
    box-shadow: 0 calc(var(--px) * 3) calc(var(--px) * 8) rgba(0, 0, 0, 0.7);
    width: var(--kom-cell);
    height: var(--kom-cell);
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--kom-line);
    background: rgba(16, 11, 9, 0.95);
}

html.ko-m .kom-mini img {
    width: 52%;
    height: 52%;
    object-fit: contain;
}



/* Yetenek çubuğu: kutu kalkar, yuvalar ekrana tek tek yerleşir */
html.ko-m .ko-skill-bar.is-v3 {
    position: fixed;
    inset: 0;
    z-index: 38;
    transform: none;
    width: auto;
    height: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    pointer-events: none;
}

html.ko-m .ko-skill-bar.is-v3 .ko-sb-line,
html.ko-m .ko-skill-bar.is-v3 .ko-sb-slots {
    position: static;
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    transform: none;
}

html.ko-m .ko-skill-bar.is-v3 .ko-sb-slot {
    position: absolute;
    margin: 0;
    padding: 0;
    pointer-events: auto;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    overflow: hidden;
    touch-action: none;
    transform: translate(50%, 50%);
    transition: transform 0.08s ease;
}

/* Yuvalar ızgarada: alt sıra 1-3, orta 4-6, üst 7-8; saldırıya en yakın yuva en küçük numara */
html.ko-m .ko-skill-bar.is-v3 .ko-sb-slots .ko-sb-slot {
    width: var(--kom-skill);
    height: var(--kom-skill);
    min-width: 0;
    min-height: 0;
    overflow: visible;
    border-radius: 50%;
    border: 1px solid #4a3925;
    background: linear-gradient(180deg, rgba(35, 29, 22, 0.97), rgba(12, 10, 8, 0.96));
    box-shadow:
        0 calc(var(--px) * 2) calc(var(--px) * 6) rgba(0, 0, 0, 0.65),
        inset 0 1px 0 rgba(255, 217, 120, 0.1);
}

html.ko-m .ko-skill-bar.is-v3 .ko-sb-slot[data-slot-key="1"] { right: var(--kom-c3); bottom: var(--kom-r4); }
html.ko-m .ko-skill-bar.is-v3 .ko-sb-slot[data-slot-key="2"] { right: var(--kom-c2); bottom: var(--kom-r4); }
html.ko-m .ko-skill-bar.is-v3 .ko-sb-slot[data-slot-key="3"] { right: var(--kom-c1); bottom: var(--kom-r4); }
html.ko-m .ko-skill-bar.is-v3 .ko-sb-slot[data-slot-key="4"] { right: var(--kom-c3); bottom: var(--kom-r3); }
html.ko-m .ko-skill-bar.is-v3 .ko-sb-slot[data-slot-key="5"] { right: var(--kom-c2); bottom: var(--kom-r3); }
html.ko-m .ko-skill-bar.is-v3 .ko-sb-slot[data-slot-key="6"] { right: var(--kom-c1); bottom: var(--kom-r3); }
html.ko-m .ko-skill-bar.is-v3 .ko-sb-slot[data-slot-key="7"] { right: var(--kom-c3); bottom: var(--kom-r2); }
html.ko-m .ko-skill-bar.is-v3 .ko-sb-slot[data-slot-key="8"] { right: var(--kom-c2); bottom: var(--kom-r2); }

html.ko-m .ko-skill-bar.is-v3 .ko-sb-slot.is-pressed,
html.ko-m .ko-skill-bar.is-v3 .ko-sb-slot:active {
    transform: translate(50%, 50%) scale(0.9);
    border-color: #ffd978;
    background: #191613;
    box-shadow: 0 0 calc(var(--px) * 7) rgba(255, 217, 120, 0.3), inset 0 0 calc(var(--px) * 5) rgba(255, 217, 120, 0.16);
}

html.ko-m .ko-skill-bar.is-v3 .ko-sb-slot.is-empty {
    opacity: 0.9;
}

html.ko-m .ko-skill-bar.is-v3 .ko-sb-slot .ko-sb-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    pointer-events: none;
}

html.ko-m .ko-skill-bar.is-v3 .ko-sb-slot.is-empty .ko-sb-icon {
    visibility: hidden;
}

html.ko-m .ko-skill-bar.is-v3 .ko-sb-slot[data-slot-type="potion"] .ko-sb-icon,
html.ko-m .ko-skill-bar.is-v3 .ko-sb-slot[data-slot-type="item"] .ko-sb-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

/* Tuş numarası yalnızca boş yuvada (dokunmatikte klavye yok) */
html.ko-m .ko-skill-bar.is-v3 .ko-sb-slot .ko-sb-key {
    display: none;
}

html.ko-m .ko-skill-bar.is-v3 .ko-sb-slot.is-empty .ko-sb-key {
    display: block;
    position: absolute;
    inset: auto;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font: 800 calc(var(--px) * 11) / 1 Tahoma, Arial, sans-serif;
    color: #a99a80;
    text-shadow: 0 1px 2px #000;
    pointer-events: none;
}

/* Adet rozeti (iksir vb.) yuvanın sağ altında */
html.ko-m .ko-skill-bar.is-v3 .ko-sb-slot .ko-sb-count {
    position: absolute;
    right: calc(var(--px) * -5);
    bottom: calc(var(--px) * -3);
    z-index: 4;
    min-width: calc(var(--px) * 16);
    padding: calc(var(--px) * 1.5) calc(var(--px) * 3);
    box-sizing: border-box;
    border-radius: calc(var(--px) * 3);
    border: 1px solid #3d3325;
    background: #100e0b;
    font: 800 calc(var(--px) * 8.5) / 1 Tahoma, Arial, sans-serif;
    color: #ffd978;
    text-align: center;
    text-shadow: none;
    pointer-events: none;
}

html.ko-m .ko-skill-bar.is-v3 .ko-sb-cd {
    inset: 0;
    border-radius: inherit;
}

html.ko-m .ko-skill-bar.is-v3 .ko-sb-cd b {
    font-size: calc(var(--px) * 13);
}




/* --------------------------------------------------------------------------
   6. SOL ALT: JOYSTICK
   -------------------------------------------------------------------------- */
html.ko-m .kom-joy-zone {
    display: block;
    position: fixed;
    left: 0;
    bottom: calc(var(--sb) + var(--px) * 116);
    /* Dokunma alanı menü ikonunun hizasında biter (ekranın yarısına uzanmaz) */
    width: calc(var(--sl-edge) + var(--px) * 232);
    height: calc(100% - var(--st) - var(--sb) - var(--px) * 260);
    z-index: 35;
    touch-action: none;
}

html.ko-m .kom-joy {
    position: absolute;
    left: calc(var(--sl) + var(--px) * 54);
    top: auto;
    bottom: 0;
    width: calc(var(--px) * 88);
    height: calc(var(--px) * 88);
    transform: translateX(-50%);
    pointer-events: none;
    opacity: 0.55;
    transition: opacity 0.15s ease;
}

html.ko-m .kom-joy.is-active {
    opacity: 1;
    transition: none;
}

html.ko-m .kom-joy-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: calc(var(--px) * 2) solid #4a3925;
    background:
        radial-gradient(circle, rgba(25, 22, 19, 0.36) 0 31%, rgba(14, 12, 10, 0.58) 32% 70%, rgba(8, 7, 6, 0.72) 100%);
    box-shadow:
        0 0 0 1px rgba(43, 37, 30, 0.7),
        inset 0 0 calc(var(--px) * 16) rgba(0, 0, 0, 0.62);
}

html.ko-m .kom-joy-knob {
    position: absolute;
    left: 50%;
    top: 50%;
    width: calc(var(--px) * 36);
    height: calc(var(--px) * 36);
    margin: calc(var(--px) * -18) 0 0 calc(var(--px) * -18);
    border-radius: 50%;
    display: grid;
    place-items: center;
    border: calc(var(--px) * 2) solid #4a3925;
    background:
        radial-gradient(circle at 38% 30%, rgba(75, 59, 38, 0.7), transparent 42%),
        linear-gradient(180deg, #231d16, #0c0a08);
    box-shadow:
        0 0 0 1px #2b251e,
        0 calc(var(--px) * 3) calc(var(--px) * 8) rgba(0, 0, 0, 0.7),
        inset 0 1px 0 rgba(255, 217, 120, 0.1);
    color: #ffd978;
    font-style: normal;
    font: 900 calc(var(--px) * 11) / 1 Tahoma, Arial, sans-serif;
    text-shadow: 0 1px 2px #000;
}

html.ko-m .kom-joy-knob::after {
    content: 'KO';
}

/* --------------------------------------------------------------------------
   7. MENÜ: düğmenin sağında açılan 7 sütunlu ikon ızgarası
   -------------------------------------------------------------------------- */
html.ko-m .kom-hub {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: transparent;
    pointer-events: none;
}

html.ko-m .kom-hub[hidden] {
    display: none;
}

html.ko-m .kom-hub-box {
    position: fixed;
    top: calc(var(--st) + var(--px) * 26);
    left: calc(var(--sl) + var(--px) * 278);
    right: auto;
    width: max-content;
    max-width: calc(100vw - var(--sl) - var(--sr) - var(--px) * 282);
    max-height: none;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    transform-origin: top left;
    animation: komDropIn 0.16s ease-out;
    pointer-events: auto;
}

html.ko-m .kom-hub-box::before {
    content: none;
}

@keyframes komDropIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.97); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    html.ko-m .kom-hub-box { animation: none; }
}

html.ko-m .kom-hub-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
    height: calc(var(--px) * 38);
    padding: 0 calc(var(--px) * 6) 0 calc(var(--px) * 14);
    border-bottom: 1px solid rgba(122, 92, 54, 0.5);
}

html.ko-m .kom-hub-head strong {
    font: 700 calc(var(--px) * 14) / 1 Georgia, serif;
    color: var(--kom-gold);
}

html.ko-m .kom-hub-close {
    display: grid;
    place-items: center;
    width: calc(var(--px) * 34);
    height: calc(var(--px) * 34);
    border: 0;
    background: none;
}

html.ko-m .kom-hub-close img {
    width: 56%;
    height: 56%;
    object-fit: contain;
}

html.ko-m .kom-hub-grid {
    display: grid;
    grid-template-columns: repeat(6, calc(var(--px) * 37));
    grid-template-rows: repeat(3, calc(var(--px) * 42));
    grid-auto-rows: calc(var(--px) * 42);
    grid-auto-flow: row;
    gap: calc(var(--px) * 3);
    width: max-content;
    padding: 0;
    overflow: visible;
}

html.ko-m .kom-hub-group {
    padding: calc(var(--px) * 6);
    border: 1px solid rgba(122, 92, 54, 0.3);
    border-radius: calc(var(--px) * 8);
    background: rgba(255, 235, 200, 0.025);
}

html.ko-m .kom-hub-group > h3 {
    margin: 0 0 calc(var(--px) * 4) calc(var(--px) * 2);
    font: 700 calc(var(--px) * 9) / 1.2 Tahoma, Arial, sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #b48a52;
}

html.ko-m .kom-hub-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: calc(var(--px) * 4);
}

html.ko-m .kom-hub-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: calc(var(--px) * 37);
    min-width: 0;
    height: calc(var(--px) * 42);
    gap: calc(var(--px) * 1);
    padding: 0;
    border: 0;
    border-radius: calc(var(--px) * 5);
    background: transparent;
    transition: background 0.12s ease, transform 0.08s ease;
}

html.ko-m .kom-hub-item:active {
    transform: scale(0.95);
    border-color: rgba(214, 178, 112, 0.5);
    background: rgba(140, 50, 35, 0.45);
}

html.ko-m .kom-hub-icon {
    display: grid;
    place-items: center;
    width: calc(var(--px) * 28);
    height: calc(var(--px) * 28);
    border-radius: 0;
    background: transparent;
    border: 0;
}

html.ko-m .kom-hub-icon img {
    width: calc(var(--px) * 27);
    height: calc(var(--px) * 27);
    object-fit: contain;
}

html.ko-m .kom-hub-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    font: 700 calc(var(--px) * 6.5) / 1 Tahoma, 'Segoe UI', Arial, sans-serif;
    color: var(--kom-text);
    white-space: nowrap;
}

html.ko-m .kom-hub-item .kom-badge {
    top: calc(var(--px) * -2);
    right: calc(var(--px) * 1);
}

/* --------------------------------------------------------------------------
   8. AÇILAN PENCERELER: soldan, kendi boyutunda
   Pencere sol kenara yaslanır ve kendi genişliği/yüksekliği kadar yer kaplar;
   ekrandan büyükse sınırda kalır ve gövdesi kayar. Sağdaki savaş kontrolleri,
   mini harita ve Menü açık kalır. Telefonda yazılar %5 büyür, tablette --u kadar.
   mobil.js, kullanılabilir alanı --kom-avail-w / --kom-avail-h olarak verir.
   -------------------------------------------------------------------------- */
html.ko-m {
    --kom-pz: max(1.05, var(--u)); /* telefonda yazılar okunur boyda */
    --kom-sheet-head: 44px;
}

html.ko-m .game-modal-stage {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    inset: 0 auto auto 0 !important;
    width: max-content;
    max-width: 100vw;
    height: auto;
    max-height: 100%;
    padding: env(safe-area-inset-top, 0px) 0 0 env(safe-area-inset-left, 0px);
    box-sizing: border-box;
    background: none;
    pointer-events: none;
    z-index: 60;
    animation: komDrawerIn 0.18s ease-out;
}

@keyframes komDrawerIn {
    from { transform: translateX(-24px); opacity: 0; }
    to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    html.ko-m .game-modal-stage {
        animation: none;
    }
}

html.ko-m .game-modal-stage > .game-modal-container,
html.ko-m .game-modal-stage > [data-side-panel="karakter"] {
    position: static !important; /* oyunun satır içi sürükleme konumu (inset !important) etkisiz kalsın */
    transform: none !important;
    margin: 0 !important;
    flex: 0 1 auto;
    min-width: 0;
    zoom: var(--kom-pz);
    pointer-events: auto;
}

html.ko-m .game-modal-stage > .game-modal-container {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    width: auto !important;
    height: auto !important;
}

/* Kapsayıcıda açık pencere yoksa yer kaplamasın */
html.ko-m .game-modal-stage > .game-modal-container:not(:has(> .side-panel:not([hidden]))) {
    display: none;
}

html.ko-m .game-modal-stage > [data-side-panel="karakter"][hidden] {
    display: none !important;
}

html.ko-m .game-modal-stage .side-panel:not([hidden]) {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    flex: 0 1 auto !important;
    min-width: 0;
    height: auto !important;
    min-height: 0 !important;
    max-width: var(--kom-avail-w1, var(--kom-avail-w, 100vw)) !important;
    max-height: calc(var(--kom-avail-h, 344px) + var(--kom-sheet-head) + 2px) !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    border: 1px solid #4e3a30 !important;
    border-top: 0 !important;
    border-left: 0 !important;
    border-radius: 0 0 8px 0 !important;
    box-shadow: 8px 8px 26px rgba(0, 0, 0, 0.75) !important;
    overflow: hidden !important;
}

/* İki pencere yan yana açıkken her biri yarım alanla sınırlı */
html.ko-m .game-modal-stage:has(> [data-side-panel="karakter"]:not([hidden])):has(> .game-modal-container > .side-panel:not([hidden])) .side-panel:not([hidden]),
html.ko-m .game-modal-stage:has(> .game-modal-container > .side-panel:not([hidden]) ~ .side-panel:not([hidden])) .side-panel:not([hidden]) {
    max-width: calc(var(--kom-avail-w, 100vw) / 2 - 4px) !important;
}

/* Başlık: dokunmaya uygun yükseklik, büyük kapatma düğmesi */
html.ko-m .game-modal-stage .side-panel > .settings-titlebar {
    height: var(--kom-sheet-head) !important;
    min-height: var(--kom-sheet-head) !important;
    flex: 0 0 auto !important;
    padding: 0 calc(var(--kom-sheet-head) + 8px) 0 14px !important;
    cursor: default !important;
}

html.ko-m .game-modal-stage .side-panel > .settings-titlebar strong {
    font-size: 16px !important;
}

html.ko-m .game-modal-stage .side-panel > .settings-titlebar [data-close-panel],
html.ko-m .game-modal-stage .side-panel > .settings-titlebar > button:last-child {
    width: var(--kom-sheet-head) !important;
    height: 100% !important;
}

html.ko-m .game-modal-stage .side-panel > .settings-titlebar [data-close-panel]::before,
html.ko-m .game-modal-stage .side-panel > .settings-titlebar > button:last-child::before {
    font-size: 24px !important;
}

/* Gövde: kalan alanı doldurur ve kendi içinde kayar */
html.ko-m .game-modal-stage .side-panel:not([hidden]) > :not(.settings-titlebar) {
    min-height: 0;
    max-height: none !important;
}

html.ko-m .game-modal-stage .side-panel:not([hidden]) > :last-child:not(.settings-titlebar) {
    flex: 1 1 auto;
    overflow-y: auto !important;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Dokunmatik hedefler: düğme ve form öğeleri en az parmak boyunda */
html.ko-m .game-modal-stage .side-panel button,
html.ko-m .game-modal-stage .side-panel select,
html.ko-m .game-modal-stage .side-panel input[type="text"],
html.ko-m .game-modal-stage .side-panel input[type="number"],
html.ko-m .game-modal-stage .side-panel input[type="search"],
html.ko-m .game-modal-stage .side-panel input:not([type]) {
    min-height: 32px;
}

html.ko-m .game-modal-stage .side-panel input[type="checkbox"],
html.ko-m .game-modal-stage .side-panel input[type="radio"] {
    width: 18px;
    height: 18px;
}

html.ko-m .game-modal-stage .side-panel input[type="range"] {
    min-height: 28px;
}

/* --- Pencere içerikleri: mobil yerleşim ------------------------------------ */

/* Pazar: başlıktaki "Pazar aç" düğmesi kapatmanın soluna */
html.ko-m .game-modal-stage .market-panel .settings-titlebar .market-add-button {
    right: var(--kom-sheet-head) !important;
    width: var(--kom-sheet-head) !important;
    height: 100% !important;
}

html.ko-m .game-modal-stage .market-panel > .settings-titlebar {
    padding-right: calc(var(--kom-sheet-head) * 2 + 8px) !important;
}

/* Çanta: yuva boyu ekran yüksekliğinden; ekipman, karakter ve çanta tek bakışta */
html.ko-m .game-modal-stage .inventory-panel:not([hidden]) {
    width: max-content !important;
}

html.ko-m .game-modal-stage .inventory-panel .inventory-body.is-v2 {
    /* Yuva boyu hem yükseklikten hem panel genişliğinden (Karakter yanında açıkken) */
    --inventory-slot-size: clamp(22px, calc((var(--kom-avail-h, 346px) - 86px) / 9.6), 46px);
    --inventory-slot-gap: 3px;
    width: auto !important;
    height: auto !important;
    padding: 8px 6px 8px 8px !important;
    grid-template-columns: max-content max-content !important;
    grid-template-rows: max-content max-content !important;
    align-content: start;
    justify-content: start !important;
    gap: 8px 8px !important;
    overflow: visible !important;
}

html.ko-m .game-modal-stage .inventory-panel .inventory-body.is-v2 > .inventory-wear {
    grid-column: 1 !important;
    grid-row: 1 !important;
}

html.ko-m .game-modal-stage .inventory-panel .inventory-body.is-v2 > .inventory-bag {
    grid-column: 2 !important;
    grid-row: 1 !important;
}

html.ko-m .game-modal-stage .inventory-panel .inventory-body.is-v2 > .inventory-depo {
    position: absolute !important;
    left: calc(100% + 8px) !important;
    top: 0 !important;
    width: max-content !important;
    margin: 0 !important;
    padding: 6px !important;
    z-index: 8;
    border: 1px solid #4e3d37 !important;
    background: rgba(10, 8, 8, 0.97) !important;
    box-shadow: inset 0 0 0 1px #261918, 0 10px 28px rgba(0, 0, 0, 0.82) !important;
}

html.ko-m .game-modal-stage .inventory-panel .inventory-body.is-v2 > .inventory-depo .inventory-depo-head {
    /* Envanter başlığıyla aynı boy ve görünüm: iki pencere üst kenardan hizalı durur */
    height: 44px !important;
    margin: -6px -6px 6px !important;
    padding: 0 6px 0 10px !important;
    gap: 6px !important;
    border-bottom: 1px solid #4e3d37;
    background: linear-gradient(90deg, rgba(58, 22, 19, 0.98), rgba(26, 13, 12, 0.96));
    box-sizing: border-box;
    font-size: 15px !important;
    overflow: hidden;
}

html.ko-m .inventory-depo-head .inventory-depo-title img {
    width: 18px;
    height: 18px;
}

html.ko-m .inventory-depo-head .inventory-depo-pages {
    margin-left: auto;
    gap: 4px !important;
}

/* Sayfa sekmeleri ve "+" eşit kare düğmeler; genel mobil düğme yüksekliği uygulanmaz */
html.ko-m .inventory-depo-head .inventory-depo-page-btn {
    width: 26px !important;
    height: 26px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 13px !important;
    line-height: 1 !important;
    box-sizing: border-box;
}

html.ko-m .inventory-depo-close {
    display: block;
    flex: 0 0 auto;
    width: 30px !important;
    height: 30px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0;
    background: url("/assets/ui/baslik/x-close.png") center / 15px 15px no-repeat;
    cursor: pointer;
}

/* Depo açıkken envanter kırpmasın: depo penceresi panelin sağ dışında durur */
html.ko-m .game-modal-stage .inventory-panel:not([hidden]):has(.inventory-depo:not([hidden])),
html.ko-m .game-modal-stage .inventory-panel:has(.inventory-depo:not([hidden])) .inventory-body.is-v2 {
    overflow: visible !important;
}

/* Karakter penceresiyle yan yana: yuva boyu yarım genişliğe göre */
html.ko-m .game-modal-stage:has(> [data-side-panel="karakter"]:not([hidden])) .inventory-panel .inventory-body.is-v2 {
    --inventory-slot-size: clamp(20px, min(calc((var(--kom-avail-h, 346px) - 86px) / 9.6), calc((var(--kom-avail-w, 800px) / 2 - 96px) / 14)), 46px);
}

html.ko-m .game-modal-stage .inventory-body.is-v2 .inventory-wear {
    grid-template-columns: var(--inventory-slot-size) calc(var(--inventory-slot-size) * 4) var(--inventory-slot-size) !important;
}

html.ko-m .game-modal-stage .inventory-body.is-v2 .inventory-slot {
    width: var(--inventory-slot-size) !important;
    height: var(--inventory-slot-size) !important;
    min-height: 0 !important;
}

/* İlk dokunuşta item seçildiğini belli eder; ikinci dokunuş işlemi yapar. */
html.ko-m .is-mobile-tap-pending {
    outline: 2px solid #e0b760 !important;
    outline-offset: -2px;
    filter: brightness(1.18);
}

html.ko-m .anvil-bag-cell,
html.ko-m .anvil-slot,
html.ko-m [data-bag-pick],
html.ko-m [data-offer-index],
html.ko-m [data-market-seller-buy],
html.ko-m [data-market-draft-remove] {
    touch-action: manipulation;
}

/* Item bilgi ve karşılaştırma kartları mobil ekranı kaplamaz. */
html.ko-m .item-tip {
    width: min(calc(var(--px) * 190), calc(48vw - 8px)) !important;
    max-height: calc(100vh - var(--st) - var(--sb) - 8px);
    border-radius: calc(var(--px) * 3) !important;
    overflow: hidden;
}

html.ko-m .item-tip-head {
    gap: calc(var(--px) * 5) !important;
    padding: calc(var(--px) * 5) calc(var(--px) * 6) !important;
}

html.ko-m .item-tip-info {
    gap: calc(var(--px) * 1.5) !important;
}

html.ko-m .item-tip-name {
    font-size: calc(var(--px) * 10) !important;
}

html.ko-m .item-tip-tier,
html.ko-m .item-tip-type,
html.ko-m .item-tip-cls {
    font-size: calc(var(--px) * 8.5) !important;
}

html.ko-m .item-tip-type img,
html.ko-m .item-tip-cls img {
    width: calc(var(--px) * 11) !important;
    height: calc(var(--px) * 11) !important;
}

html.ko-m .item-tip-req {
    padding: 1px calc(var(--px) * 5) !important;
    font-size: calc(var(--px) * 8) !important;
}

html.ko-m .item-tip-req b,
html.ko-m .item-tip-pic em,
html.ko-m .item-tip-pic-wrapper em {
    font-size: calc(var(--px) * 9) !important;
}

html.ko-m .item-tip-pic,
html.ko-m .item-tip-pic-wrapper {
    width: calc(var(--px) * 45) !important;
    height: calc(var(--px) * 45) !important;
}

html.ko-m .item-tip-body {
    gap: calc(var(--px) * 3) !important;
    padding: calc(var(--px) * 5) calc(var(--px) * 7) calc(var(--px) * 6) !important;
}

html.ko-m .item-tip-desc {
    padding: calc(var(--px) * 4) calc(var(--px) * 5) !important;
    font-size: calc(var(--px) * 8) !important;
    line-height: 1.2 !important;
}

html.ko-m .item-tip-row {
    gap: calc(var(--px) * 4) !important;
    font-size: calc(var(--px) * 8.5) !important;
}

html.ko-m .item-tip-row i {
    width: calc(var(--px) * 6) !important;
    height: calc(var(--px) * 6) !important;
    border-width: 1px !important;
}

html.ko-m .item-tip-row b {
    font-size: calc(var(--px) * 9) !important;
}

html.ko-m .item-tip-diff {
    min-width: calc(var(--px) * 25) !important;
    margin-left: calc(var(--px) * 3) !important;
    font-size: calc(var(--px) * 8) !important;
}

html.ko-m .item-tip-code,
html.ko-m .item-tip-trade,
html.ko-m .item-tip-hint {
    font-size: calc(var(--px) * 8.5) !important;
}

html.ko-m .game-modal-stage .inventory-body.is-v2 .inventory-character-card {
    width: auto !important;
    height: auto !important;
}

html.ko-m .game-modal-stage .inventory-body.is-v2 .inventory-character-art {
    width: 90% !important;
    max-height: 92% !important;
}

html.ko-m .game-modal-stage .inventory-body.is-v2 .inventory-bag-grid {
    gap: var(--inventory-slot-gap) !important;
}

html.ko-m .game-modal-stage .inventory-body.is-v2 .inv2-footer {
    height: 34px !important;
}

html.ko-m .game-modal-stage .inventory-body.is-v2 .inv2-footer .inv2-depo,
html.ko-m .game-modal-stage .inventory-body.is-v2 .inv2-footer .inv2-trash {
    flex: 0 0 34px !important;
    width: 34px !important;
    height: 34px !important;
}

/* Ticaret / pazar sırasında çanta yalnız ızgara: boş ekipman sütunu ve kenar boşluğu kalkar */
html.ko-m .game-modal-stage .inventory-panel.is-bag-only .inventory-body.is-v2 {
    grid-template-columns: max-content !important;
    padding: 8px 10px !important;
}

html.ko-m .game-modal-stage .inventory-panel.is-bag-only .inventory-body.is-v2 > * {
    grid-column: 1 !important;
}

html.ko-m .game-modal-stage .inventory-panel.is-bag-only .inventory-body.is-v2 > .inv2-footer.is-left,
html.ko-m .game-modal-stage .inventory-panel.is-bag-only .inventory-body.is-v2 > .inventory-wear {
    display: none !important;
}

/* Yetenek: liste solda, seçili yeteneğin ayrıntısı sağda */
html.ko-m .game-modal-stage .skill-panel:not([hidden]) {
    width: 560px !important;
    height: calc(var(--kom-avail-h, 344px) + var(--kom-sheet-head)) !important;
}

html.ko-m .game-modal-stage .skill-panel .skill-body {
    display: grid !important;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 6px 10px;
    padding: 8px 10px !important;
    overflow: hidden !important;
}

html.ko-m .game-modal-stage .skill-body > .skill-top-strip { grid-column: 1; grid-row: 1; }
html.ko-m .game-modal-stage .skill-body > .skill-tabs-bar { grid-column: 1; grid-row: 2; height: auto !important; }

html.ko-m .game-modal-stage .skill-body > .skill-pages-wrap {
    grid-column: 1;
    grid-row: 3;
    height: auto !important;
    max-height: none !important;
    overflow-y: auto !important;
}

html.ko-m .game-modal-stage .skill-body > .skill-book-section {
    grid-column: 2;
    grid-row: 1 / -1;
    height: auto !important;
    min-height: 0;
    overflow-y: auto !important;
}

html.ko-m .game-modal-stage .skill-body .skill-book-container {
    height: auto !important;
    min-height: 100%;
    overflow: visible !important;
}

/* Gate: önizleme | bölge listesi | bölge bilgisi yan yana, düğmeler altta */
html.ko-m .game-modal-stage .warp-list-panel:not([hidden]) {
    width: 560px !important;
    height: calc(var(--kom-avail-h, 344px) + var(--kom-sheet-head)) !important;
}

html.ko-m .game-modal-stage .warp-list-panel .warp-body {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) minmax(0, 0.9fr);
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 8px 10px;
    padding: 8px 10px !important;
    overflow: hidden !important;
}

html.ko-m .game-modal-stage .warp-body > .warp-top-row {
    display: contents !important;
}

html.ko-m .game-modal-stage .warp-body .warp-preview-col {
    grid-column: 1;
    grid-row: 1;
    height: auto !important;
}

html.ko-m .game-modal-stage .warp-body .warp-dest-col {
    grid-column: 2;
    grid-row: 1;
    height: auto !important;
    min-height: 0;
    overflow-y: auto !important;
}

html.ko-m .game-modal-stage .warp-body .warp-dest-col {
    display: flex !important;
    flex-direction: column;
    overflow: hidden !important;
}

html.ko-m .game-modal-stage .warp-body .warp-dest-list {
    flex: 1 1 auto;
    height: auto !important;
    max-height: none !important;
    min-height: 0;
}

html.ko-m .game-modal-stage .warp-body > .warp-warning-section {
    grid-column: 3;
    grid-row: 1;
    display: flex !important;
    flex-direction: column;
    min-height: 0;
    height: auto !important;
    margin: 0 !important;
}

html.ko-m .game-modal-stage .warp-body .warp-warning-box {
    flex: 1 1 auto;
    height: auto !important;
    max-height: none !important;
}

html.ko-m .game-modal-stage .warp-body > .warp-list-footer {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0 !important;
}

html.ko-m .game-modal-stage .warp-body .warp-list-footer .ko-action-btn {
    min-width: 110px;
    min-height: 36px;
}

/* Mağaza: KO-Noah bakiyesi kategori listesinin en üstünde */
html.ko-m .game-modal-stage .store-sidebar .store-wallet {
    order: -1;
    margin: 0 0 8px !important;
}

/* Tam boy pencereler: içerik alanı ekran yüksekliğini doldurur, yalnız liste kayar */
html.ko-m .game-modal-stage .mail-panel:not([hidden]),
html.ko-m .game-modal-stage .event-panel:not([hidden]),
html.ko-m .game-modal-stage .store-panel:not([hidden]),
html.ko-m .game-modal-stage .quest-panel:not([hidden]) {
    height: calc(var(--kom-avail-h, 344px) + var(--kom-sheet-head)) !important;
}

/* Mektup: liste kayar, sayfa düğmeleri altta sabit */
html.ko-m .game-modal-stage .mail-panel .mail-body {
    display: flex !important;
    flex-direction: column;
    overflow: hidden !important;
    padding-bottom: 8px !important;
}

html.ko-m .game-modal-stage .mail-panel .mail-head {
    flex: 0 0 auto;
}

html.ko-m .game-modal-stage .mail-panel .mail-view {
    flex: 1 1 auto;
    min-height: 0 !important;
    height: auto !important;
}

html.ko-m .game-modal-stage .mail-panel .mail-view:not(.mail-detail) {
    display: flex;
    flex-direction: column;
}

html.ko-m .game-modal-stage .mail-panel .mail-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
}

html.ko-m .game-modal-stage .mail-panel .mail-pager {
    flex: 0 0 auto;
    margin-top: 6px !important;
}

html.ko-m .game-modal-stage .mail-panel .mail-detail {
    overflow-y: auto !important;
}

/* Etkinlik: üstte ay ve sayaçlar tek satırda, altında sıkı takvim; gün ayrıntısı
   pencerenin içinde açılır */
html.ko-m .game-modal-stage .event-panel:not([hidden]) {
    width: min(520px, var(--kom-avail-w1, 520px)) !important;
}

html.ko-m .game-modal-stage .event-panel .event-body {
    flex: 1 1 auto;
    min-height: 0;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas:
        "nav stats"
        "week week"
        "cal cal";
    gap: 6px 8px;
    padding: 8px 10px 10px !important;
    overflow: hidden !important;
}

html.ko-m .game-modal-stage .event-panel .event-overview {
    display: contents !important;
}

html.ko-m .game-modal-stage .event-panel .event-overview-copy {
    display: none !important;
}

html.ko-m .game-modal-stage .event-panel .event-overview-stats {
    grid-area: stats;
    display: flex !important;
    gap: 4px;
    margin: 0 !important;
}

html.ko-m .game-modal-stage .event-panel .event-overview-stats > span {
    min-width: 46px;
    height: 34px;
    padding: 0 6px !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

html.ko-m .game-modal-stage .event-panel .event-overview-stats b {
    font-size: 13px !important;
    line-height: 1 !important;
}

html.ko-m .game-modal-stage .event-panel .event-overview-stats small {
    font-size: 8px !important;
    line-height: 1.2 !important;
}

html.ko-m .game-modal-stage .event-panel .event-nav {
    grid-area: nav;
    height: 34px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

html.ko-m .game-modal-stage .event-panel .event-nav-btn {
    width: 34px !important;
    min-height: 0 !important;
    height: 100% !important;
}

html.ko-m .game-modal-stage .event-panel .event-month-year {
    font-size: 15px !important;
}

html.ko-m .game-modal-stage .event-panel .event-weekdays {
    grid-area: week;
    gap: 3px !important;
    margin: 0 !important;
}

html.ko-m .game-modal-stage .event-panel .event-weekdays > span {
    height: 18px !important;
    min-height: 0 !important;
    font-size: 9px !important;
    border: 0 !important;
    background: none !important;
    color: var(--kom-muted) !important;
}

html.ko-m .game-modal-stage .event-panel .event-calendar-grid {
    grid-area: cal;
    min-height: 0;
    gap: 3px !important;
    grid-template-rows: none !important;
    grid-auto-rows: minmax(0, 1fr) !important;
    margin: 0 !important;
}

html.ko-m .game-modal-stage .event-panel .event-day {
    min-height: 0 !important;
    height: auto !important;
    aspect-ratio: auto !important;
    padding: 3px 5px !important;
    border: 1px solid rgba(255, 235, 200, 0.06) !important;
    border-radius: 5px !important;
    background: rgba(255, 240, 210, 0.035) !important;
    box-shadow: none !important;
    overflow: hidden;
    cursor: pointer;
}

html.ko-m .game-modal-stage .event-panel .event-day.is-other-month {
    opacity: 0.35;
}

html.ko-m .game-modal-stage .event-panel .event-day.is-today {
    border-color: var(--kom-gold) !important;
    background: rgba(214, 160, 80, 0.14) !important;
}

html.ko-m .game-modal-stage .event-panel .event-day-number {
    font-size: 12px !important;
    line-height: 1 !important;
}

/* Gün ayrıntısı pencerenin üstünde, aynı boyda açılır */
html.ko-m .game-modal-stage .event-panel .event-detail-side {
    position: absolute !important;
    inset: var(--kom-sheet-head) 0 0 0 !important;
    width: auto !important;
    height: auto !important;
    border: 0 !important;
    border-radius: 0 !important;
    z-index: 9 !important;
}

html.ko-m .game-modal-stage .event-panel .event-detail-side[hidden] {
    display: none !important;
}

html.ko-m .game-modal-stage .event-panel .event-detail-side > .settings-titlebar {
    height: 40px !important;
}

html.ko-m .game-modal-stage .event-panel .event-detail-side > .settings-titlebar [data-event-detail-close] {
    width: 44px !important;
}

/* Mağaza: kategori menüsü sabit, yalnız ürünler kayar */
html.ko-m .game-modal-stage .store-panel .store-shell {
    grid-template-rows: minmax(0, 1fr) !important;
    overflow: hidden !important;
    height: auto !important;
}

html.ko-m .game-modal-stage .store-panel .store-sidebar {
    height: auto !important;
    min-height: 0;
    overflow-y: auto;
}

html.ko-m .game-modal-stage .store-panel .store-catalog {
    height: auto !important;
    min-height: 0;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Görevler: üst şerit sabit, tablo kalan alanı doldurur ve kayar */
html.ko-m .game-modal-stage .quest-panel .quest-body {
    display: flex !important;
    flex-direction: column;
    overflow: hidden !important;
}

html.ko-m .game-modal-stage .quest-panel .quest-board-topbar {
    flex: 0 0 auto;
}

html.ko-m .game-modal-stage .quest-panel .quest-table-container {
    flex: 1 1 auto;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

/* Görevler: sıra sütunu kalkar, sütunlar panel genişliğine göre daralır */
html.ko-m .game-modal-stage .quest-panel .quest-board-topbar {
    flex-wrap: wrap;
    gap: 6px;
}

html.ko-m .game-modal-stage .quest-panel .quest-count-badge {
    display: none;
}

html.ko-m .game-modal-stage .quest-board-table {
    width: 100% !important;
    min-width: 0 !important;
}

html.ko-m .game-modal-stage .quest-board-table {
    table-layout: fixed !important;
}

/* Tablo genişlikleri colgroup'tan gelir: sıra sütunu sıfırlanır, kalanlar orantılı */
html.ko-m .game-modal-stage .quest-board-table col:nth-child(1) { width: 0 !important; }
html.ko-m .game-modal-stage .quest-board-table col:nth-child(2) { width: 20% !important; }
html.ko-m .game-modal-stage .quest-board-table col:nth-child(3) { width: auto !important; }
html.ko-m .game-modal-stage .quest-board-table col:nth-child(4) { width: 13% !important; }
html.ko-m .game-modal-stage .quest-board-table col:nth-child(5) { width: 15% !important; }
html.ko-m .game-modal-stage .quest-board-table col:nth-child(6) { width: 24% !important; }

html.ko-m .game-modal-stage .quest-board-table th:first-child,
html.ko-m .game-modal-stage .quest-board-table td:first-child {
    width: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    font-size: 0 !important;
    overflow: hidden;
}

html.ko-m .game-modal-stage .quest-board-table th,
html.ko-m .game-modal-stage .quest-board-table td {
    padding-left: 5px !important;
    padding-right: 5px !important;
}

html.ko-m .game-modal-stage .quest-board-table .quest-prog-cell,
html.ko-m .game-modal-stage .quest-board-table .quest-prog-bar {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
}

html.ko-m .game-modal-stage .quest-board-table td {
    overflow-wrap: anywhere;
}


/* Pencere açıkken sol taraftaki kontroller panelin altında kalır; sağdaki savaş
   kontrolleri açık kalır. Üst ikonlar yalnızca Menü olarak kalır. */
html.ko-m.ko-m-panel .kom-topbar .kom-top-btn:not(.is-menu),
html.ko-m.ko-m-panel .kom-top-toggle {
    display: none;
}

html.ko-m.ko-m-panel .kom-joy-zone,
html.ko-m.ko-m-panel .kom-camera-control,
html.ko-m.ko-m-panel .kom-chat-btn,
html.ko-m.ko-m-panel .ko-hud-buff-slots,
html.ko-m.ko-m-panel .ko-gm-admin-entry,
html.ko-m.ko-m-panel .ko-chat-zone,
html.ko-m.ko-m-panel .target-frame,
html.ko-m.ko-m-chat .kom-joy-zone,
html.ko-m.ko-m-chat .kom-camera-control,
html.ko-m.ko-m-chat .kom-actions,
html.ko-m.ko-m-chat .ko-skill-bar.is-v3 {
    visibility: hidden;
    pointer-events: none;
}

/* Otomatik av ayarları açıkken: ayarlar solda, Yetenek penceresi sağda */
html.ko-m.ko-m-genie .ko-top-right-wrap {
    z-index: 96;
}

html.ko-m.ko-m-genie .ko-genie-settings-modal {
    left: var(--sl);
    right: auto;
    top: 50%;
    transform: translateY(-50%);
    width: calc(50vw - var(--sl) - 8px);
    max-height: calc(100% - var(--st) - var(--sb));
}

html.ko-m.ko-m-genie .game-modal-stage {
    inset: 0 auto auto 50vw !important;
    max-width: 50vw;
}

html.ko-m.ko-m-genie .game-modal-stage .skill-panel:not([hidden]) {
    width: calc(var(--kom-avail-w, 50vw)) !important;
}

/* Oto av modunda Yetenek yalnızca liste: dokunulan yetenek oto ava eklenir */
html.ko-m.ko-m-genie .game-modal-stage .skill-body {
    grid-template-columns: minmax(0, 1fr) !important;
}

html.ko-m.ko-m-genie .game-modal-stage .skill-body > .skill-book-section {
    display: none !important;
}

html.ko-m.ko-m-genie .ko-server-cards,
html.ko-m.ko-m-genie .ko-minimap {
    visibility: hidden;
}

html.ko-m.ko-m-genie .kom-actions,
html.ko-m.ko-m-genie .kom-camera-control,
html.ko-m.ko-m-genie .ko-skill-bar.is-v3,
html.ko-m.ko-m-genie .kom-joy-zone,
html.ko-m.ko-m-genie .kom-topbar,
html.ko-m.ko-m-genie .kom-chat-btn,
html.ko-m.ko-m-genie .ko-chat-zone,
html.ko-m.ko-m-genie .map-boss-tracker {
    visibility: hidden;
    pointer-events: none;
}

/* Sürükle-bırak sırasında yetenek yuvaları pencere üstünde görünür kalsın */
html.ko-m.ko-m-panel body.is-dragging-skill .ko-skill-bar.is-v3 {
    visibility: visible;
}

/* İstek, onay ve diğer küçük pencereler ekran içinde */
html.ko-m .ko-requests {
    top: calc(var(--st) + var(--px) * 96);
    max-width: 92vw;
    z-index: 90;
}

html.ko-m .ko-request {
    width: min(300px, 88vw);
}

/* KO Guard sorusu klavye açılınca görünür kalsın diye üstte durur */
html.ko-m .ko-guard-modal {
    margin: calc(var(--st) + 4px) auto auto;
}

html.ko-m .ko-guard-modal,
html.ko-m .market-buy-modal,
html.ko-m .market-price-modal,
html.ko-m .ko-trash-modal,
html.ko-m .ko-death-prompt {
    max-width: 94vw;
    max-height: 92vh;
    overflow: auto;
    z-index: 95;
}

/* --------------------------------------------------------------------------
   9. DİKEY EKRAN: yatay çevir uyarısı
   -------------------------------------------------------------------------- */
html.ko-m .kom-rotate {
    position: fixed;
    inset: 0;
    z-index: 100000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px;
    background: #0b0807;
    color: var(--kom-text);
    text-align: center;
}

html.ko-m.ko-m-portrait .kom-rotate {
    display: flex;
}

html.ko-m .kom-rotate img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    animation: komRotate 2.2s ease-in-out infinite;
}

html.ko-m .kom-rotate strong {
    font: 700 20px/1.2 Georgia, serif;
    color: var(--kom-gold);
}

html.ko-m .kom-rotate p {
    margin: 0;
    font: 13px/1.4 Tahoma, Arial, sans-serif;
    color: var(--kom-muted);
}

@keyframes komRotate {
    0%, 15% { transform: rotate(0deg); }
    50%, 65% { transform: rotate(-90deg); }
    100% { transform: rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
    html.ko-m .kom-rotate img {
        animation: none;
    }
}

/* ==========================================================================
   LOBİ & GİRİŞ SAYFALARI MOBİL YATAY (LANDSCAPE) UYARLAMASI
   login, register, server, select-area, character, character-create
   ========================================================================== */
@media screen and (orientation: landscape) and (max-height: 600px),
       screen and (max-width: 1024px) and (max-height: 560px) {

    /* --------------------------------------------------------------------------
       1. GİRİŞ VE KAYIT EKRANLARI (login.php & register.php)
       -------------------------------------------------------------------------- */
    body.auth-world-page {
        overflow-y: auto !important;
        position: relative !important;
        min-height: 100vh !important;
        height: auto !important;
    }

    body.auth-world-page .auth-world {
        padding: calc(6px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-right, 0px) * 0.45) calc(6px + env(safe-area-inset-bottom, 0px)) calc(16px + env(safe-area-inset-left, 0px) * 0.45) !important;
        min-height: 100vh !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }

    body.auth-world-page .auth-world-card {
        width: min(440px, 94vw) !important;
        max-height: 94vh !important;
        overflow-y: auto !important;
        padding: 12px 20px !important;
        background: rgba(10, 10, 12, 0.88) !important;
        border: 1px solid rgba(151, 139, 126, 0.45) !important;
        border-radius: 6px !important;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.85) !important;
        backdrop-filter: blur(8px) !important;
    }

    body.auth-world-page .auth-world-brand {
        margin: 0 auto 8px !important;
        font-size: 20px !important;
        letter-spacing: 2px !important;
    }

    body.auth-world-page .auth-brand-mark {
        font-size: 16px !important;
        margin-bottom: 2px !important;
    }

    body.auth-world-page .auth-world-brand i {
        display: none !important;
    }

    body.auth-world-page .auth-world-tabs {
        margin-bottom: 10px !important;
    }

    body.auth-world-page .auth-world-tabs a {
        padding: 6px 4px !important;
        font-size: 12px !important;
    }

    body.auth-world-page .auth-world-form {
        gap: 8px !important;
    }

    body.auth-world-page .auth-world-field {
        margin: 0 !important;
    }

    body.auth-world-page .auth-world-input {
        min-height: 38px !important;
        height: 38px !important;
        grid-template-columns: 36px minmax(0, 1fr) 36px !important;
    }

    body.auth-world-page .auth-world-input > i {
        font-size: 14px !important;
    }

    body.auth-world-page .auth-world-input input {
        height: 36px !important;
        min-height: 36px !important;
        padding: 4px 10px !important;
        font-size: 13px !important;
    }

    body.auth-world-page .auth-world-check {
        font-size: 11px !important;
        gap: 6px !important;
    }

    body.auth-world-page .auth-world-check input {
        width: 13px !important;
        height: 13px !important;
    }

    body.auth-world-page .auth-world-submit {
        min-height: 38px !important;
        height: 38px !important;
        font-size: 14px !important;
        padding: 6px 20px !important;
        margin-top: 4px !important;
    }

    body.auth-world-page .auth-world-submit b {
        font-size: 18px !important;
        right: 12px !important;
    }

    body.auth-world-page .auth-world-switch {
        margin-top: 8px !important;
        padding-top: 8px !important;
        font-size: 11px !important;
    }

    body.auth-world-page .auth-world-two-col {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    body.auth-world-page .auth-world-two-col .auth-world-input {
        min-height: 36px !important;
        height: 36px !important;
    }

    /* --------------------------------------------------------------------------
       2. SUNUCU SEÇİM EKRANI (server.php)
       -------------------------------------------------------------------------- */
    body.world-select-page {
        overflow: hidden !important;
        position: fixed !important;
        width: 100vw !important;
        height: 100vh !important;
    }

    body.world-select-page .world-select {
        height: 100vh !important;
        min-height: 0 !important;
        padding: calc(6px + env(safe-area-inset-top, 0px)) calc(12px + env(safe-area-inset-right, 0px) * 0.45) calc(6px + env(safe-area-inset-bottom, 0px)) calc(12px + env(safe-area-inset-left, 0px) * 0.45) !important;
        display: grid !important;
        grid-template-columns: 210px 1fr !important;
        grid-template-rows: 1fr auto !important;
        gap: 4px 14px !important;
        box-sizing: border-box !important;
    }

    body.world-select-page .world-heading {
        grid-column: 1 !important;
        grid-row: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
    }

    body.world-select-page .world-heading h1 {
        font-size: 22px !important;
        line-height: 1.15 !important;
    }

    body.world-select-page .world-heading p {
        font-size: 11px !important;
        margin: 4px 0 0 !important;
        color: #b5ada3 !important;
    }

    body.world-select-page .world-rule {
        width: 140px !important;
        margin-top: 6px !important;
    }

    body.world-select-page .world-browser {
        grid-column: 2 !important;
        grid-row: 1 / span 2 !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        margin-top: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
        overflow: hidden !important;
    }

    body.world-select-page .world-filters {
        margin: 0 0 6px !important;
        width: 100% !important;
    }

    body.world-select-page .world-filters button {
        height: 32px !important;
        min-height: 32px !important;
        font-size: 12px !important;
        padding: 4px 8px !important;
    }

    body.world-select-page .world-columns {
        padding: 5px 10px !important;
        font-size: 9px !important;
        margin-bottom: 4px !important;
        grid-template-columns: minmax(0, 2fr) minmax(0, 1.1fr) minmax(0, 1.2fr) 32px !important;
    }

    body.world-select-page .world-columns > span:nth-child(3) {
        display: none !important;
    }

    body.world-select-page .world-list {
        overflow-y: auto !important;
        flex: 1 !important;
        gap: 5px !important;
        scrollbar-width: thin !important;
    }

    body.world-select-page .world-row {
        min-height: 40px !important;
    }

    body.world-select-page .world-server {
        padding: 6px 10px !important;
        font-size: 12px !important;
        grid-template-columns: minmax(0, 2fr) minmax(0, 1.1fr) minmax(0, 1.2fr) !important;
    }

    body.world-select-page .world-region {
        display: none !important;
    }

    body.world-select-page .world-name strong {
        font-size: 14px !important;
    }

    body.world-select-page .world-name .world-emblem {
        font-size: 20px !important;
    }

    body.world-select-page .world-state {
        font-size: 11px !important;
    }

    body.world-select-page .world-population {
        font-size: 11px !important;
        gap: 6px !important;
    }

    body.world-select-page .world-bars i {
        height: 12px !important;
        width: 3px !important;
    }

    body.world-select-page .world-expand {
        width: 34px !important;
        min-width: 34px !important;
        min-height: 40px !important;
        font-size: 18px !important;
    }

    body.world-select-page .channel-row {
        padding: 6px 10px !important;
        font-size: 11px !important;
        min-height: 34px !important;
    }

    body.world-select-page .world-action.is-small {
        font-size: 12px !important;
        min-height: 28px !important;
        padding: 3px 12px !important;
    }

    body.world-select-page .world-footer {
        grid-column: 1 !important;
        grid-row: 2 !important;
        min-height: 38px !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    body.world-select-page .world-action.is-back {
        min-height: 34px !important;
        height: 34px !important;
        font-size: 12px !important;
        padding: 4px 14px !important;
        min-width: 0 !important;
        width: 100% !important;
    }

    /* --------------------------------------------------------------------------
       3. IRK SEÇİM EKRANI (select-area.php)
       -------------------------------------------------------------------------- */
    body.area-select-page {
        overflow: hidden !important;
    }

    body.area-select-page .area-select {
        height: 100vh !important;
        min-height: 0 !important;
    }

    body.area-select-page .area-side {
        padding: calc(10px + env(safe-area-inset-top, 0px)) calc(12px + env(safe-area-inset-right, 0px) * 0.45) calc(10px + env(safe-area-inset-bottom, 0px)) calc(12px + env(safe-area-inset-left, 0px) * 0.45) !important;
    }

    body.area-select-page .area-side-content {
        gap: 6px !important;
        width: 90% !important;
    }

    body.area-select-page .area-emblem {
        width: 58px !important;
        height: 58px !important;
    }

    body.area-select-page .area-side strong {
        font-size: 18px !important;
        letter-spacing: 1px !important;
    }

    body.area-select-page .area-caption {
        font-size: 11px !important;
        line-height: 1.3 !important;
        max-width: 280px !important;
    }

    body.area-select-page .area-select-hint {
        font-size: 11px !important;
        min-height: 28px !important;
        padding: 4px 16px !important;
        margin-top: 4px !important;
    }

    /* --------------------------------------------------------------------------
       4. KARAKTER SEÇİMİ VE OLUŞTURMA (character.php & character-create.php)
       -------------------------------------------------------------------------- */
    body.hero-select-page {
        overflow: hidden !important;
        position: fixed !important;
        width: 100vw !important;
        height: 100vh !important;
    }

    body.hero-select-page .hero-select {
        height: 100vh !important;
        min-height: 0 !important;
        padding: calc(4px + env(safe-area-inset-top, 0px)) calc(10px + env(safe-area-inset-right, 0px) * 0.45) calc(4px + env(safe-area-inset-bottom, 0px)) calc(10px + env(safe-area-inset-left, 0px) * 0.45) !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }

    body.hero-select-page .hero-select-header {
        min-height: 38px !important;
        padding: 0 0 4px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    body.hero-select-page .hero-select-header > div::after {
        display: none !important;
    }

    body.hero-select-page .hero-select-header > div {
        padding-bottom: 0 !important;
        display: flex !important;
        align-items: baseline !important;
        gap: 8px !important;
    }

    body.hero-select-page .hero-select-brand {
        font-size: 9px !important;
    }

    body.hero-select-page .hero-select h1 {
        font-size: 18px !important;
        margin: 0 !important;
    }

    body.hero-select-page .hero-select-subtitle {
        display: none !important;
    }

    body.hero-select-page .hero-select-server {
        margin: 0 !important;
        font-size: 12px !important;
        gap: 6px !important;
    }

    body.hero-select-page .hero-select-server strong {
        font-size: 12px !important;
    }

    body.hero-select-page .location-channel,
    body.hero-select-page .character-channel-status {
        font-size: 10px !important;
    }

    body.hero-select-page .character-select-layout,
    body.hero-select-page .creator-layout {
        display: grid !important;
        grid-template-columns: 190px 1fr 200px !important;
        gap: 8px !important;
        flex: 1 !important;
        min-height: 0 !important;
        padding: 4px 0 !important;
        overflow: hidden !important;
    }

    body.hero-select-page .character-roster {
        display: flex !important;
        flex-direction: column !important;
        gap: 4px !important;
        overflow-y: auto !important;
        padding-right: 2px !important;
    }

    body.hero-select-page .roster-entry {
        min-height: 48px !important;
        height: 48px !important;
        padding: 4px 8px !important;
        gap: 6px !important;
    }

    body.hero-select-page .roster-class-icon {
        width: 24px !important;
        height: 24px !important;
    }

    body.hero-select-page .roster-copy strong {
        font-size: 12px !important;
    }

    body.hero-select-page .roster-copy small {
        font-size: 9px !important;
    }

    body.hero-select-page .character-showcase,
    body.hero-select-page .creator-showcase {
        position: relative !important;
        height: 100% !important;
        min-height: 0 !important;
    }

    body.hero-select-page .character-stage {
        height: 100% !important;
        min-height: 0 !important;
    }

    body.hero-select-page .character-info {
        background: rgba(14, 11, 10, 0.9) !important;
        border: 1px solid #4a3832 !important;
        padding: 6px 8px !important;
        overflow-y: auto !important;
        max-height: 100% !important;
        font-size: 11px !important;
    }

    body.hero-select-page .character-info-heading {
        gap: 6px !important;
        padding-bottom: 4px !important;
        margin-bottom: 4px !important;
    }

    body.hero-select-page .info-class-icon {
        width: 24px !important;
        height: 24px !important;
    }

    body.hero-select-page .character-info-stats {
        gap: 2px !important;
        padding-top: 4px !important;
    }

    body.hero-select-page .character-info-stats h2,
    body.hero-select-page .character-equipment h2 {
        font-size: 10px !important;
        margin-bottom: 2px !important;
    }

    body.hero-select-page .character-info-stats > div {
        font-size: 9px !important;
    }

    body.hero-select-page .creator-class-list {
        display: flex !important;
        flex-direction: column !important;
        gap: 3px !important;
        overflow-y: auto !important;
    }

    body.hero-select-page .creator-class {
        min-height: 40px !important;
        height: 40px !important;
        padding: 3px 6px !important;
        font-size: 11px !important;
    }

    body.hero-select-page .creator-gender-grid {
        margin-bottom: 4px !important;
    }

    body.hero-select-page .creator-gender-grid button {
        height: 28px !important;
        font-size: 11px !important;
    }

    body.hero-select-page .hero-name-field input {
        height: 34px !important;
        font-size: 12px !important;
        padding: 4px 8px !important;
    }

    body.hero-select-page .hero-select-footer {
        min-height: 40px !important;
        padding: 4px 0 0 !important;
        border-top: 1px solid #383537 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    body.hero-select-page .hero-back {
        font-size: 11px !important;
        padding: 4px 8px !important;
    }

    body.hero-select-page .hero-enter {
        min-width: 140px !important;
        min-height: 34px !important;
        height: 34px !important;
        padding: 4px 16px !important;
        font-size: 12px !important;
    }
}

/* Karakter seçimi / oluşturma: telefon yatay ekranında taşmaları önler */
@media screen and (orientation: landscape) and (max-height: 600px),
       screen and (max-width: 1024px) and (max-height: 560px) {
    body.hero-select-page .roster-entry,
    body.hero-select-page .creator-class {
        flex: 0 0 auto !important;
    }

    body.hero-select-page .roster-entry.is-empty {
        min-height: 44px !important;
        height: 44px !important;
    }

    body.hero-select-page .roster-add {
        width: 28px !important;
        height: 28px !important;
        font-size: 22px !important;
    }

    body.hero-select-page .character-info {
        overflow-x: hidden !important;
    }

    body.hero-select-page .character-info-heading {
        align-items: center !important;
        gap: 8px !important;
    }

    body.hero-select-page .info-class-icon {
        width: 30px !important;
        height: 30px !important;
    }

    body.hero-select-page .info-class-icon img {
        width: 26px !important;
        height: 26px !important;
    }

    body.hero-select-page .character-info-heading strong {
        font-size: 15px !important;
    }

    body.hero-select-page .character-info-heading small {
        font-size: 10px !important;
    }

    body.hero-select-page .character-info-line {
        padding: 5px 0 !important;
        font-size: 11px !important;
    }

    body.hero-select-page .character-info-stats > div {
        margin: 4px 0 !important;
        grid-template-columns: 30px 1fr 24px !important;
        gap: 6px !important;
    }

    body.hero-select-page .hero-select-footer {
        margin: 0 !important;
        min-height: 0 !important;
        padding: 6px 0 calc(4px + env(safe-area-inset-bottom, 0px)) !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
    }

    body.hero-select-page .character-select-footer .hero-back,
    body.hero-select-page .hero-back {
        min-width: 0 !important;
        height: 34px !important;
        padding: 4px 14px !important;
        font-size: 12px !important;
        gap: 8px !important;
    }

    body.hero-select-page .hero-enter {
        min-width: 140px !important;
        min-height: 34px !important;
        height: 34px !important;
        font-size: 13px !important;
    }

    body.hero-select-page .creator-class-panel {
        min-height: 0 !important;
        overflow-y: auto !important;
    }

    body.hero-select-page .creator-gender-grid button {
        min-height: 30px !important;
    }
}

/* Sunucu seçimi ve karakter seçimi: telefon yatay ekranı için sıkılaştırma */
@media screen and (orientation: landscape) and (max-height: 600px),
       screen and (max-width: 1024px) and (max-height: 560px) {
    /* Sunucu seçimi: başlık sol sütunun üstünde */
    body.world-select-page .world-heading {
        justify-content: flex-start !important;
        padding-top: 6px !important;
    }

    /* Karakter seçimi: üç sütun ekrana dengeli, liste üstten başlar */
    body.hero-select-page .character-select-layout {
        grid-template-columns: 200px minmax(0, 1fr) 214px !important;
        gap: 10px !important;
        align-items: stretch !important;
    }

    body.hero-select-page .character-roster {
        align-self: start !important;
        max-height: 100% !important;
        gap: 5px !important;
        padding: 0 2px 0 0 !important;
    }

    body.hero-select-page .roster-entry {
        height: auto !important;
        min-height: 46px !important;
        padding: 5px 8px !important;
        gap: 8px !important;
        align-items: center !important;
    }

    body.hero-select-page .roster-entry.is-empty {
        min-height: 40px !important;
        height: 40px !important;
    }

    body.hero-select-page .roster-class-icon {
        flex: 0 0 30px !important;
        width: 30px !important;
        height: 30px !important;
    }

    body.hero-select-page .roster-class-icon img {
        width: 22px !important;
        height: 22px !important;
    }

    body.hero-select-page .roster-copy {
        gap: 1px !important;
        min-width: 0 !important;
    }

    body.hero-select-page .roster-copy strong {
        font-size: 13px !important;
        line-height: 1.15 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        overflow-wrap: normal !important;
    }

    body.hero-select-page .roster-copy small {
        font-size: 10px !important;
        line-height: 1.2 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    body.hero-select-page .roster-entry.is-empty .roster-copy strong {
        font-size: 12px !important;
    }

    /* Bilgi paneli: sıkı satırlar, giyili eşyalar tam görünür */
    body.hero-select-page .character-info {
        padding: 8px 10px !important;
        scrollbar-width: thin;
    }

    body.hero-select-page .character-info-heading {
        padding-bottom: 4px !important;
        margin-bottom: 2px !important;
    }

    body.hero-select-page .character-info-heading strong {
        font-size: 14px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    body.hero-select-page .character-info-line {
        padding: 2px 0 !important;
        font-size: 10.5px !important;
    }

    body.hero-select-page .character-info h2 {
        margin: 4px 0 2px !important;
        font-size: 10.5px !important;
    }

    body.hero-select-page .character-info-stats > div {
        margin: 0 !important;
        font-size: 10px !important;
    }

    body.hero-select-page [data-detail-equipment] {
        grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
        gap: 2px !important;
    }

    body.hero-select-page .character-equip-slot .inventory-plus {
        font-size: 7.5px !important;
        top: 0 !important;
        left: 1px !important;
    }
}

/* Envanter: basılı tutunca item sürüklemeye hazır olduğunu gösterir */
html.ko-m .inventory-panel .is-touch-hold {
    outline: 2px solid #ffd978;
    outline-offset: -2px;
    filter: brightness(1.25);
}

/* Skill alanı sayfa okları: mobil-icon klasöründeki sağ / sol ok görselleri (◀ ▶ yazısı gizlenir) */
html.ko-m .kom-ctrl .ko-sb-page-arrow[data-sb-page] {
    font-size: 0 !important;
    color: transparent !important;
    text-shadow: none !important;
}

html.ko-m .kom-ctrl .ko-sb-page-arrow[data-sb-page]::before {
    content: "";
    display: block;
    width: 46%;
    height: 50%;
    margin: auto;
    background: url("/assets/ui/mobil-icon/sag-drop-64.png") center / contain no-repeat;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.85));
    pointer-events: none;
}

html.ko-m .kom-ctrl .ko-sb-page-arrow[data-sb-page="prev"]::before {
    background-image: url("/assets/ui/mobil-icon/sol-drop-64.png");
}

html.ko-m .kom-ctrl .ko-sb-page-arrow[data-sb-page] {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Oto Av üst düğmeleri: görsel boyut aynı, parmak için dokunma alanı genişletilir */
html.ko-m .ko-server-cards .ko-genie-btn,
html.ko-m .ko-server-cards .ko-genie-mini {
    position: relative;
    touch-action: manipulation;
}

html.ko-m .ko-server-cards .ko-genie-btn::after,
html.ko-m .ko-server-cards .ko-genie-mini::after {
    content: "";
    position: absolute;
    inset: calc(var(--px) * -5);
}

/* iOS ana ekran uygulaması yatayda kısa yükseklik raporladığında (mobil.js fixStandaloneHeight):
   sayfa gerçek ekran boyuna uzar; gövde sabit konumlu arayüzün referans kutusu olur. */
html.ko-m.kom-fullh,
html.ko-m.kom-fullh body.game-page {
    bottom: auto !important;
    height: var(--kom-full-h, 100%) !important;
    overflow: hidden;
}

html.ko-m.kom-fullh body.game-page {
    transform: translateZ(0);
}
