/* KAYDIRMALI DOĞRULAMA PENCERESİ (MarsGames Aşama 5 · giris.md 12.2; iş 0E)
   Bileşen: assets/js/kaydirmali-dogrulama.js (window.MGKaydir). Renkler tokens.css değişkenleri; dolgu kızılı #E8001A,
   vurgu metni #FF5C6B (KARARLAR "Metin vurgusu"). Görsel en çok 300 px, ekranın 48 px dar halinde küçülür; yatay telefonda
   (yükseklik 480 px altı) başlık tek satır, görsel en çok 42vh, pencere 100dvh içinde kendi kaydırmasıyla. */
.mgk-perde {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  background: rgba(5, 8, 12, 0.72);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.mgk-pencere {
  --mgk-gorsel: min(300px, calc(100vw - 48px));
  box-sizing: border-box;
  width: calc(var(--mgk-gorsel) + 30px);   /* 2 x 14 px dolgu + 2 x 1 px kenar: 320 px ekranda da 100vw - 16 px içinde */
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  max-height: calc(100dvh - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 14px 16px;
  border: 1px solid var(--hy-border, #233047);
  border-radius: var(--hy-radius-xl, 16px);
  background: var(--hy-surface, #1A2235);
  color: var(--hy-text, #FFFFFF);
  font-family: var(--hy-font-body, Inter, 'Segoe UI', system-ui, sans-serif);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  outline: none;
}
.mgk-ust {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.mgk-baslik {
  margin: 0;
  min-width: 0;
  font-size: 1.0625rem;
  line-height: 1.3;
  font-weight: 700;
  color: var(--hy-text, #FFFFFF);
}
.mgk-kapat {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: -6px -8px -6px 0;
  padding: 0;
  border: 0;
  border-radius: var(--hy-radius-pill, 999px);
  background: transparent;
  color: var(--hy-text-muted, #AEB9CC);
  cursor: pointer;
}
.mgk-kapat:hover { color: var(--hy-text, #FFFFFF); background: var(--hy-surface-hover, #202A40); }
.mgk-yonerge {
  margin: 0 0 10px;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--hy-text-muted, #AEB9CC);
}
.mgk-sahne {
  position: relative;
  width: var(--mgk-gorsel);
  aspect-ratio: 2 / 1;
  overflow: hidden;
  border-radius: var(--hy-radius-md, 8px);
  background: var(--hy-bg, #0D1117);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.mgk-arka {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.mgk-parca {
  position: absolute;
  left: 0;
  top: 0;
  width: auto;
  max-width: none;
  cursor: grab;
  touch-action: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.55));
}
.mgk-parca:not([src]) { visibility: hidden; }
.mgk-bekliyor .mgk-parca { cursor: default; }
.mgk-yukleniyor {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  color: var(--hy-text-muted, #AEB9CC);
}
.mgk-yukleniyor[hidden] { display: none; }
.mgk-tamam { box-shadow: 0 0 0 2px #2FBF71; }

.mgk-ray {
  position: relative;
  width: var(--mgk-gorsel);
  height: 44px;
  margin-top: 10px;
  border: 1px solid var(--hy-border, #233047);
  border-radius: var(--hy-radius-pill, 999px);
  background: var(--hy-bg-elevated, #111827);
  touch-action: none;
  box-sizing: border-box;
}
.mgk-dolgu {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: var(--hy-radius-pill, 999px);
  background: rgba(232, 0, 26, 0.22);
  pointer-events: none;
}
.mgk-tutamac {
  position: absolute;
  top: -1px;
  left: 0;
  box-sizing: border-box;
  width: 56px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--hy-radius-pill, 999px);
  background: #E8001A;
  color: #FFFFFF;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.mgk-tutamac:active { cursor: grabbing; }
.mgk-tutamac[aria-disabled="true"] { background: var(--hy-border-strong, #2E3A52); color: var(--hy-text-subtle, #95A1B6); cursor: default; }
.mgk-tutamac:focus { outline: none; }
.mgk-tutamac:focus-visible,
.mgk-kapat:focus-visible,
.mgk-yenile:focus-visible { outline: 2px solid #FF5C6B; outline-offset: 2px; }

.mgk-klavye {
  margin: 8px 0 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--hy-text-subtle, #95A1B6);
}
.mgk-alt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}
.mgk-durum {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 1.25em;
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--hy-text-muted, #AEB9CC);
}
.mgk-durum-hata { color: #FF5C6B; }
.mgk-durum-tamam { color: #2FBF71; font-weight: 700; }
.mgk-yenile {
  flex: none;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--hy-border-strong, #2E3A52);
  border-radius: var(--hy-radius-pill, 999px);
  background: transparent;
  color: var(--hy-text, #FFFFFF);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}
.mgk-yenile:hover { background: var(--hy-surface-hover, #202A40); }

@media (prefers-reduced-motion: no-preference) {
  .mgk-titre { animation: mgk-titre 0.36s ease-in-out; }
  @keyframes mgk-titre {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
  }
}

/* Yatay telefon: başlık tek satır, görsel en çok 42vh (en/boy 2:1 olduğu için en en çok 84vh), aralıklar sıkı. */
@media (max-height: 480px) {
  .mgk-pencere {
    --mgk-gorsel: min(300px, calc(100vw - 48px), 84vh);
    padding: 10px 14px 12px;
  }
  .mgk-baslik { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1rem; }
  .mgk-ust { margin-bottom: 2px; }
  .mgk-yonerge { margin-bottom: 6px; font-size: 0.8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mgk-ray { margin-top: 6px; height: 40px; }
  .mgk-tutamac { height: 40px; }
  .mgk-klavye { margin-top: 4px; }
  .mgk-alt { margin-top: 4px; }
}
