/* =====================================================================================================================================
   ADIM 206 — 101 Okey lobisi "GERÇEKÇİ MASA" (3/4 açı sahne; KULLANICI seçimi B). Yalnız okey_masa_sahne_enabled AÇIKKEN yüklenir
   (includes/okey_masa_sahne.php → pages/lobby.php, pages/lobby_misafir.php); kapalıyken bugünkü daire görünüm (game.css) aynen kalır.
   Çizim: assets/js/okey-masa-sahne.js (katman konumları satır içi stil, % — sahne genişliğiyle ölçeklenir). Bütün kurallar
   .masa-widget.masa-sahne altında; lacivert temanın (:not(_)) ve Hafif Mod'un kuralları daha ağır seçiciyle geçersiz kılınır.
   Katmanlar (alttan üste): zemin gölgesi · arka sandalyeler · arka oyuncular · masa · gösterge · ıstakalar · masa ışığı · tabela ·
   ön sandalyeler · ön oyuncular · OTUR · sayı rozeti.
   ===================================================================================================================================== */
.masa-widget.masa-sahne {
  width: min(266px, 100%);
  height: auto;
  aspect-ratio: 200 / 148;
  margin: 5% auto 0;
  container-type: inline-size;
}
@media (max-width: 480px) {
  .masa-widget.masa-sahne.masa-sahne { width: 100%; height: auto; }
}
.masa-widget.masa-sahne > img {
  position: absolute;
  display: block;
  max-width: none;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}
/* zemin gölgesi (eski .masa-felt öğesi; lacivert temanın / oynanan masanın / yüksek masanın masa-felt kuralları burada geçersiz) */
.masa-widget.masa-sahne.masa-sahne .masa-felt {
  inset: auto;
  z-index: 1;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(10, 20, 45, 0.42), rgba(10, 20, 45, 0.16) 62%, rgba(10, 20, 45, 0));
  box-shadow: none;
}
.masa-widget.masa-sahne .ms-sandalye.ms-arka { z-index: 2; }
.masa-widget.masa-sahne .masa-seat.filled.ms-arka { z-index: 3; }
.masa-widget.masa-sahne .ms-masa { z-index: 4; }
.masa-widget.masa-sahne .ms-gosterge { z-index: 5; }
.masa-widget.masa-sahne .ms-istaka { z-index: 6; }
.masa-widget.masa-sahne .ms-sandalye.ms-on { z-index: 9; }
.masa-widget.masa-sahne .masa-seat.filled.ms-on { z-index: 10; }

/* oturan oyuncu: bugünkü avatar dairesi (beyaz halka), sahnede yerinde */
.masa-widget.masa-sahne .masa-seat.filled {
  transform: none;
  border-width: 2px;
  box-shadow: 0 3px 7px rgba(0, 0, 0, 0.45);
}

/* boş koltuk: dokunma alanı sandalyenin tamamı, "OTUR" düğmesi oturakta (her boş koltuğun kendi düğmesi) */
.masa-widget.masa-sahne.masa-sahne .masa-seat.empty {
  z-index: 11;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  animation: none;
  transform: none;
  transition: none;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.masa-widget.masa-sahne.masa-sahne .masa-seat.empty:hover { transform: none; box-shadow: none; }
.masa-widget.masa-sahne .ms-otur {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 0.3em 0.66em;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 6.2cqw;
  font-weight: 800;
  letter-spacing: 0.3px;
  line-height: 1.1;
  color: #fff;
  background: linear-gradient(160deg, #4fd48a, #124ab8);
  box-shadow: 0 0 0 1.6px #fff, 0 3px 8px rgba(0, 0, 0, 0.4);
  animation: msOturNabiz 1.8s ease-in-out infinite;
}
.masa-widget.masa-sahne .masa-seat.empty:hover .ms-otur,
.masa-widget.masa-sahne .masa-seat.empty:focus-visible .ms-otur {
  animation-play-state: paused;
  transform: translate(-50%, -50%) scale(1.1);
  filter: brightness(1.08);
}
@keyframes msOturNabiz {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.07); }
}
/* oynanan (dolu sayılan) masada verisi olmayan koltuk: yalnız sönük sandalye görünür */
.masa-widget.masa-sahne.masa-sahne .masa-seat.empty-static {
  z-index: 11;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: transparent;
  font-size: 0;
  transform: none;
}

/* oynanan masada çuhanın lamba ışığı yavaşça "nefes alır" (yalnız saydamlık — telefonu yormaz) */
.masa-widget.masa-sahne .ms-isik {
  position: absolute;
  z-index: 7;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 232, 160, 0.42), rgba(255, 232, 160, 0.12) 58%, rgba(255, 232, 160, 0));
  opacity: 0;
  animation: msNefes 4s ease-in-out infinite;
}
@keyframes msNefes {
  0%, 100% { opacity: 0; }
  50% { opacity: 0.85; }
}

/* masa numarası tabelası: #no · el · giriş parası (bugünkü .masa-center-info öğesi). Genişlik içeriğe göre (max-content) — sol:%50'deki mutlak
   konumlu kutunun "kalan yer = sahnenin yarısı" sınırına takılıp alt satırı kırmasın (İngilizce "1 Hand · 1,100" iki satıra bölünüyordu). */
.masa-widget.masa-sahne.masa-sahne .masa-center-info {
  z-index: 8;
  width: max-content;
  max-width: 92%;
  transform: translate(-50%, -100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2cqw;
  padding: 1.1cqw 2.4cqw 1.3cqw;
  border-radius: 1.6cqw;
  line-height: 1.08;
  white-space: nowrap;
  color: #6b4b10;
  text-shadow: none;
  background: linear-gradient(180deg, #fffaf0, #efe4c9);
  border: 0.5cqw solid #b98b2d;
  box-shadow: 0 0.45cqw 0 #8a6418, 0 2.4cqw 2.2cqw rgba(0, 0, 0, 0.42);
}
.masa-widget.masa-sahne.masa-sahne .masa-center-number {
  text-align: center;
  font-size: 6.6cqw;
  font-weight: 800;
  color: #1b2f5f;
  opacity: 1;
  letter-spacing: 0.2px;
}
.masa-widget.masa-sahne .ms-tabela-alt { display: flex; align-items: center; gap: 0.3em; white-space: nowrap; }
.masa-widget.masa-sahne.masa-sahne .masa-center-meta {
  font-size: 5.6cqw;
  font-weight: 700;
  color: #6b4b10;
}
.masa-widget.masa-sahne.masa-sahne .masa-center-meta.stake {
  display: inline-flex;
  align-items: center;
  gap: 0.22em;
  color: #6b4b10;
}
.masa-widget.masa-sahne.masa-sahne .masa-center-meta.stake::before { content: "·"; margin-right: 0.08em; }
.masa-widget.masa-sahne .ms-para { width: 1em; height: 1em; flex-shrink: 0; }
/* yüksek giriş paralı masa: altın tabela (kartın altın çerçevesi game.css'te aynen) */
.table-row.is-high-stake .masa-widget.masa-sahne.masa-sahne .masa-center-info {
  border-color: #e2b64a;
  background: linear-gradient(180deg, #fff7dc, #f3dc9a);
  box-shadow: 0 0.45cqw 0 #8a6418, 0 0 0 0.45cqw rgba(243, 210, 122, 0.5), 0 2.4cqw 2.2cqw rgba(0, 0, 0, 0.42);
}
.table-list .table-row.is-high-stake .masa-widget.masa-sahne.masa-sahne .masa-felt { border: 0; box-shadow: none; }

/* sayı rozeti (1/4): arka-sağ oyuncunun başına binmesin diye sahnenin köşesinin biraz dışında */
.masa-widget.masa-sahne.masa-sahne .tr-icon-count { z-index: 12; top: -6%; right: -2%; }

/* Hafif Mod + "hareketi azalt": nabız / nefes durur (görüntü aynı) */
html.ok-lite .masa-widget.masa-sahne .ms-otur,
html.ok-lite .masa-widget.masa-sahne .ms-isik { animation: none; }
html.ok-lite .masa-widget.masa-sahne .ms-isik { opacity: 0.35; }
@media (prefers-reduced-motion: reduce) {
  .masa-widget.masa-sahne .ms-otur, .masa-widget.masa-sahne .ms-isik { animation: none; }
  .masa-widget.masa-sahne .ms-isik { opacity: 0.35; }
}
