/* 101 Okey masa düzeni (okey.css üzerine). Ortada açılan perler; 22 taşlık ıstaka (2 × 17); sağda açma düğmeleri. */
.ok101 #okStage { --tw: min(3.35cqw, 7cqh); }
.ok101 #okStage .tier { grid-template-columns: repeat(17, var(--tw)); gap: .25cqw; padding-bottom: 1.5cqh; }
.ok101 #okStage .slot { margin-bottom: .6cqh; }
.ok101 #okStage .rack { bottom: 1.2cqh; padding: 1cqh 1.2cqw 0; }


/* Deste ve gösterge: sol sütun */
.ok101 #okStage .center { left: 50%; top: 33cqh; transform: translateX(-50%); gap: 1.6cqw; flex-direction: row; align-items: flex-end; }
.ok101 #okStage .center .gost small { font-size: 2.1cqh; }
.ok101 #okStage .pile .cnt { right: -1.2cqw; }

/* Atılan taşlar */
.ok101 #dLeft { left: 1.2cqw; width: 17cqw; top: 44cqh; }
.ok101 #dMine { right: 1.2cqw; width: 17cqw; top: 44cqh; left: auto; }
.ok101 #dTop { left: 31cqw; top: 2cqh; }
.ok101 #dRight { right: 31cqw; top: 2cqh; }

/* Açılan perler */
.ok101 #okStage .melds { position: absolute; top: 13cqh; bottom: 40cqh; z-index: 3; display: flex; flex-direction: column; border-radius: 1cqw; background: #00000022; }
.ok101 #okStage .melds.runs { left: 19cqw; right: 57cqw; }
.ok101 #okStage .melds.pairs { left: 57cqw; right: 19cqw; }
.ok101 #okStage .melds .mh { flex: none; padding: .6cqh 1cqw 0; font: 700 2.4cqh/1.3 Georgia, serif; color: #f0d8c8b0; letter-spacing: .04em; }
.ok101 #okStage .melds .mlist { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 1.2cqh 1cqw; padding: .6cqh 1cqw 1cqh; }
.ok101 #okStage .melds .mempty { margin: auto; color: #f0d8c870; font: 400 2.6cqh/1.3 Georgia, serif; }
.ok101 #okStage .meld { display: flex; gap: .15cqw; padding: .5cqh .4cqw .9cqh; border-radius: .6cqw; background: #2a0f0b88; border-bottom: .5cqh solid var(--own, #9a7440); cursor: copy; }
.ok101 #okStage .meld .tile { --w: min(2.3cqw, 4.8cqh); box-shadow: inset 0 1px 0 #fff, 0 .3cqh 0 #c9b68c, 0 .5cqh .8cqh #0008; }
.ok101 #okStage .meld .tile.joker::before { font-size: calc(var(--w) * .22); top: calc(var(--w) * -.24); }
.ok101 #okStage .meld.own0 { --own: #f2b544; } .ok101 #okStage .meld.own1 { --own: #4fc3ff; } .ok101 #okStage .meld.own2 { --own: #ff7ab8; } .ok101 #okStage .meld.own3 { --own: #6fe08a; }
.ok101 #okStage .meld.over { background: #3fd06a44; outline: 2px solid #3fd06a; }


/* Yan düğmeler: sağda üç düğme */
.ok101 #okStage .side-btns { bottom: 2cqh; gap: 1.2cqh; }
.ok101 #okStage .side-btns.left { left: 1.6cqw; }
.ok101 #okStage .side-btns.right { right: 1.6cqw; }
.ok101 #okStage .side-btns button { min-width: 14cqw; height: 8cqh; font-size: 2.9cqh; }
.ok101 #okStage .side-btns button[hidden] { display: none; }

.ok101 #okStage .hud { top: 1.6cqh; left: 1.6cqw; font-size: 2.3cqh; padding: .6cqh 1cqw; max-width: 22cqw; }
.ok101 #okStage .hud b { font-size: 2.6cqh; }
.ok101 #okStage .tools { top: 1.6cqh; right: 1.6cqw; }
.ok101 #okStage .tools button { width: 8cqh; height: 8cqh; }
/* Masa bilgisi: sol üstte küçük kutu */
.ok101 #okStage .hud { display: flex; left: 1.2cqw; top: 1.2cqh; transform: none; width: auto; max-width: 17cqw; align-items: flex-start; text-align: left; gap: .25cqh; padding: .5cqh .7cqw; border-radius: .6cqw; }
.ok101 #okStage .hud span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ok101 #okStage .hud .hl { font: 400 1.7cqh/1.2 system-ui, sans-serif; color: #d9c8a6; }
.ok101 #okStage .hud .hm { font: 700 2cqh/1.2 Georgia, serif; color: #f2b544; }
.ok101 #okStage .hud .hm i { font-style: normal; color: #bba57f; font-weight: 400; }
.ok101 #okStage .hud .tags { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: .25cqh .25cqw; white-space: normal; }
.ok101 #okStage .hud .tags em { font: 600 1.45cqh/1.45 system-ui, sans-serif; font-style: normal; padding: 0 .4cqw; border-radius: 99px; background: #2a1b10; border: 1px solid #6a5034; color: #e9dbbd; }

/* El sonu / puan tablosu */
#okHand { position: absolute; inset: 0; z-index: 48; display: none; align-items: center; justify-content: center; background: #0b0503b8; backdrop-filter: blur(2px); }
#okHand.on { display: flex; }
#okHand .hb { width: min(80cqw, 160cqh); max-height: 92cqh; overflow-y: auto; padding: 3cqh 3cqw; border-radius: 1.6cqw; text-align: center;
  background: radial-gradient(120% 60% at 50% 0%, #4a1c16 0%, #2a120d 60%, #1b0b08 100%); border: 2px solid #c79a4a; box-shadow: 0 3cqh 6cqh #000c; }
#okHand h2 { margin: 0 0 .6cqh; font: 700 6cqh/1.1 Georgia, serif; color: #f6ead0; }
#okHand #okHandText { font-size: 3cqh; color: #e9dbbd; margin-bottom: 2cqh; }
#okHand .hnext { font-size: 2.8cqh; color: #f2b544; margin-top: 1.6cqh; }
#okHand button { margin-top: 1.6cqh; height: 8cqh; padding: 0 3cqw; border-radius: 1cqw; font: 700 3cqh/1 Georgia, serif; background: linear-gradient(#24170d, #1a1009); border: 2px solid #9a7440; color: #f3e6cc; }
.stab { width: 100%; border-collapse: collapse; font-size: 2.9cqh; color: #f3e6cc; }
.stab th { font: 600 2.5cqh/1.3 system-ui, sans-serif; color: #bba57f; padding: .6cqh .8cqw; border-bottom: 1px solid #6a5034; }
.stab td { padding: .8cqh .8cqw; border-bottom: 1px solid #3e2c1a; }
.stab td:first-child, .stab th:first-child { text-align: left; }
.stab td small { color: #f08a7a; font-size: 2.2cqh; }
.stab tr.me td:first-child { color: #f2b544; }
.stab tr.best td { background: #3fd06a1f; }
.stab tr.best td:last-child b { color: #7fd38a; }
#okEnd .ehand .stab { margin-bottom: 1cqh; }

/* Bu tur indirilen ama açılışa henüz yetmeyen perler (Geri topla ile alınabilir) */
.ok101 #okStage .meld.stage { outline: 2px dashed #f2b544; outline-offset: 2px; background: #f2b5441a; }
/* İşlenebilir taş: sağ üst köşede kırmızı nokta */
.ok101 #okStage .tile.islek { background-image: radial-gradient(circle at 82% 12%, #e0261d 0 9%, #8d0f0a 9.5% 11%, transparent 11.5%), linear-gradient(170deg, #fffef9 0%, #fbf5e7 45%, #efe4cb 100%); }
.ok101 #okStage .tile.islek.flip { background-image: linear-gradient(170deg, #f9f2e2, #eadcbc); }
.stab tr.team td { background: #ffffff0d; font-weight: 600; color: #f6ead0; }
/* Sol sütunda dört düğme */
.ok101 #okStage .side-btns.left button, .ok101 #okStage .side-btns.right button { height: 7.2cqh; font-size: 2.7cqh; }
.ok101 #okStage .side-btns { gap: 1cqh; }


.ok101 #okStage .melds .mh span { font: 400 2.2cqh/1.3 system-ui, sans-serif; color: #e9dbbd; letter-spacing: 0; }
.ok101 #okStage .melds .mh span b { color: #f2b544; font-weight: 700; }
/* Basılı tutulan / seçili taşın işlenebileceği perler */
.ok101 #okStage .meld.fit { background: #3fd06a2e; box-shadow: 0 0 0 2px #3fd06a, 0 0 2cqh #3fd06a99; animation: okFit 1s ease-in-out infinite; }
@keyframes okFit { 50% { box-shadow: 0 0 0 2px #3fd06a, 0 0 .6cqh #3fd06a55; } }

/* 101 masa seçimi: açılır menü stilleri site.css içinde (ortak) */
.site .sheet.qm.ok101-sheet { width: min(100%, 640px); }
.stab td .rk { display: inline-block; min-width: 1.6em; color: #bba57f; font-weight: 600; }
.stab tr.best td .rk { color: #7fd38a; }

/* Istaka ve taşlar biraz daha büyük, yan düğmeler daha küçük */
.ok101 #okStage .rack { --tw: var(--rtw); }
.ok101 #okStage .side-btns { bottom: 1.6cqh; gap: .9cqh; }
.ok101 #okStage .side-btns.left { left: 1cqw; }
.ok101 #okStage .side-btns.right { right: 1cqw; }
.ok101 #okStage .side-btns button, .ok101 #okStage .side-btns.left button, .ok101 #okStage .side-btns.right button { min-width: 10cqw; height: 6.2cqh; padding: 0 .8cqw; font-size: 2.3cqh; }


/* Oyuncu kartları (ortak kart): rakipler dikey, kendi kartım ıstakanın üstünde yatay. Üstteki kart iki per alanının arasına sığar. */
.ok101 #okStage { --rtw: min(3.8cqw, 7.9cqh); }
.ok101 #plTop { top: 1cqh; --okart-fs: clamp(7px, min(2.05cqh, 1.1cqw), 13px); }
.ok101 #plLeft { left: 1.2cqw; top: 12cqh; }
.ok101 #plRight { right: 1.2cqw; top: 12cqh; }
/* 101 ıstakası: yükseklik = 2.76 × taş + 4.2cqh + 1cqh üst boşluk, alttan 1.2cqh */
.ok101 #plMe { bottom: calc(var(--rtw) * 2.76 + 7.6cqh); }
.ok101 #okStage .okart.own0 { --own: #f2b544; } .ok101 #okStage .okart.own1 { --own: #4fc3ff; } .ok101 #okStage .okart.own2 { --own: #ff7ab8; } .ok101 #okStage .okart.own3 { --own: #6fe08a; }
.ok101 #okStage .okart::after { content: ''; position: absolute; left: 50%; bottom: -.55em; width: 3.4em; height: .4em; border-radius: 99px; background: var(--own, transparent); transform: translateX(-50%); }
.ok101 #okStage .okart.row::after { bottom: -.5em; }
.ok101 #okStage .okart.partner { border-color: #6fe08a; }
.ok101 #okStage .okart .ok-stat .op { color: #8fe0a0; }
.ok101 #okStage .okart .ok-stat .pen { color: #ff9a85; }
.ok101 #okStage .okart .ok-stat .hint { color: #2a1606; background: linear-gradient(#ffd77a, #eaa93d); padding: 0 .5em; border-radius: 99px; font: 700 .85em/1.5 system-ui, sans-serif; }
