/* Setgon reference pass v2: applied to the in-chat game panel on every viewport. */
/* Setgon reference pass · waiting-table portrait view
   Based on the user-provided demo.setgon.com screenshot (20 Nov 2026).
   Loaded after board-fix.css; interaction and existing SG markup remain unchanged.
*/

  #sg-games {
    --felt-1: #087d55;
    --felt-2: #056342;
    --felt-3: #013a27;
    background: #0b0c0d;
  }

  /* Black Setgon-style application header. */
  #sg-games .sg-hud {
    height: 68px;
    padding: 8px 14px;
    background: linear-gradient(180deg, #0d0e10, #111214);
    border-bottom: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 3px 12px rgba(0,0,0,.45);
  }
  #sg-games .sg-hud-left { gap: 10px; }
  #sg-games .sg-hud-left::before {
    content: '♜';
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(145deg, #ffe89a, #e9aa2e);
    color: #704b08;
    font-size: 23px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.5), 0 2px 5px rgba(0,0,0,.45);
  }
  #sg-games .sg-hud-left::after {
    content: 'Oyunlar';
    color: #f5f5f5;
    font: 800 23px/1 'Trebuchet MS', sans-serif;
  }
  #sg-games .sg-level,
  #sg-games .sg-pill { display: none; }
  #sg-games .sg-hud-right { gap: 8px; }
  #sg-games .sg-hud-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
  }
  #sg-games .sg-hud-btn svg { width: 64%; height: 64%; stroke: #e7e7e7; }
  #sg-games .sg-hud-btn[data-action="sound"] { display: none; }
  #sg-games .sg-hud-chat {
    width: 124px;
    border-radius: 15px;
    background: linear-gradient(180deg, #49222d, #30151d);
    box-shadow: inset 0 0 0 1px #b24761, 0 3px 7px rgba(0,0,0,.4);
  }
  #sg-games .sg-hud-chat svg { display: none; }
  #sg-games .sg-hud-chat::after {
    content: 'Salonlar';
    color: #f49ca8;
    font: 800 17px/1 'Trebuchet MS', sans-serif;
  }
  #sg-games .sg-hud-btn[data-action="menu"] {
    background: linear-gradient(145deg, #ffe78e, #ce941d);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.5), 0 3px 7px rgba(0,0,0,.45);
  }
  #sg-games .sg-hud-btn[data-action="menu"] svg { stroke: #4e3509; }
  #sg-games .sg-hud-close { display: grid; }

  /* The table begins immediately below the header, as in the reference. */
  #sg-games .sg-table-wrap {
    left: 0;
    right: 0;
    top: 68px;
    bottom: 34%;
  }
  #sg-games .sg-table {
    padding: 0;
    border-radius: 0;
    background:
      linear-gradient(180deg, #a86930 0%, #74401e 14%, #482513 55%, #2a180d 100%);
    box-shadow: inset 0 2px 0 rgba(255,220,160,.25), 0 5px 13px rgba(0,0,0,.55);
  }
  #sg-games .sg-table::after { border-radius: 0; box-shadow: inset 0 0 0 1px rgba(255,220,170,.18); }
  #sg-games .sg-felt {
    border-radius: 0;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.25), inset 0 9px 24px rgba(0,0,0,.18);
    background:
      radial-gradient(125% 85% at 50% 16%, #07835a 0%, #056541 56%, #01412c 100%);
  }
  #sg-games .sg-felt::after { opacity: .35; }

  /* Slim wood rails at left and right of the felt. */
  #sg-games .sg-table-wrap::before,
  #sg-games .sg-table-wrap::after {
    content: '';
    position: absolute;
    top: 22%;
    bottom: 40%;
    width: 11px;
    z-index: 5;
    background: linear-gradient(90deg, #70401f, #c5833b 45%, #75411d);
    box-shadow: 0 0 6px rgba(0,0,0,.55);
    pointer-events: none;
  }
  #sg-games .sg-table-wrap::before { left: 0; }
  #sg-games .sg-table-wrap::after { right: 0; }

  /* Empty seats: dark recessed rectangles like Setgon's waiting state. */
  #sg-games .sg-seat { z-index: 7; }
  #sg-games .sg-seat-top { top: 1%; }
  #sg-games .sg-seat-left { left: 5%; top: 12%; }
  #sg-games .sg-seat-right { right: 5%; top: 12%; }
  #sg-games .sg-seat-self { bottom: 1%; }
  #sg-games .sg-seat .sg-plate { border-radius: 999px; }

  /* Compact side controls and a tall, wood-framed lower rack. */
  #sg-games .sg-dock {
    left: 0;
    right: 0;
    bottom: 0;
    height: 32%;
    gap: 0;
    align-items: stretch;
  }
  #sg-games .sg-side {
    width: 38px;
    border-radius: 0;
    background: linear-gradient(90deg, #8a4c22, #b87532 45%, #75401d);
    box-shadow: inset 0 0 0 1px rgba(255,216,156,.25), 0 0 6px rgba(0,0,0,.5);
    color: rgba(255,245,215,.75);
  }
  #sg-games .sg-side span { font-size: 0; }
  #sg-games .sg-side span::after { content: '+ OTUR'; font-size: 8px; letter-spacing: .12em; }
  #sg-games .sg-side-left span::after,
  #sg-games .sg-side-right span::after { writing-mode: vertical-rl; transform: rotate(180deg); }
  #sg-games .sg-rack {
    border-radius: 0;
    padding: 8px 6px;
    background:
      url('./assets/setgon-board.png') center / 100% 100% no-repeat,
      linear-gradient(180deg, #d18a3d, #7b3713 50%, #b86825);
    box-shadow: inset 0 2px 0 rgba(255,236,183,.7), inset 0 -8px 13px rgba(0,0,0,.5), 0 -2px 8px rgba(0,0,0,.45);
  }
  #sg-games .sg-rack-brand { min-height: 24px; }
  #sg-games .sg-brand { display: none; }
  #sg-games .sg-rack-row { gap: 2px; }
  #sg-games .sg-controls { background: transparent; box-shadow: none; }

/* Video reference: envelope action and right-side table chat. */
#sg-games .sg-message-fab {
  position: absolute;
  right: 21%;
  bottom: 33%;
  z-index: 24;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 2px solid #ffe38b;
  border-radius: 50%;
  color: #fff8d5;
  cursor: pointer;
  background: linear-gradient(145deg, #ffe78e, #c88618);
  box-shadow: inset 0 0 0 2px rgba(106,62,5,.55), 0 3px 8px rgba(0,0,0,.55);
}
#sg-games .sg-message-fab svg { width: 23px; height: 23px; fill: none; stroke: #fff8d5; stroke-width: 1.8; stroke-linejoin: round; }
#sg-games .sg-chat-panel {
  top: 68px;
  right: 0;
  bottom: 0;
  width: min(390px, 40vw);
  border-radius: 16px 0 0 16px;
  background: linear-gradient(180deg, rgba(10,27,24,.98), rgba(4,14,12,.99));
  box-shadow: -12px 0 30px rgba(0,0,0,.52), inset 1px 0 0 rgba(255,225,150,.18);
}
#sg-games .sg-chat-head { min-height: 54px; padding: 14px 16px; background: rgba(0,0,0,.2); }
#sg-games .sg-chat-head strong { font-size: 16px; }
#sg-games .sg-chat-list { max-height: none; height: calc(100% - 112px); padding: 16px; }
#sg-games .sg-chat-empty { margin: auto; text-align: center; color: rgba(255,255,255,.58); }
#sg-games .sg-chat-form { min-height: 58px; padding: 10px 12px; background: rgba(0,0,0,.26); }
#sg-games .sg-chat-form input { border-radius: 999px; padding: 10px 13px; }
@media (max-width: 720px) {
  #sg-games .sg-message-fab { right: 22%; bottom: 26%; width: 36px; height: 36px; }
  #sg-games .sg-chat-panel { width: min(360px, 88vw); }
}

/* Portrait parity: never replace the table with a rotate prompt; keep the same rack. */
#sg-games .sg-orient { display: none !important; }
@media (max-width: 720px) and (orientation: portrait) {
  #sg-games .sg-table-wrap { top: 68px !important; bottom: 34% !important; left: 0 !important; right: 0 !important; }
  #sg-games .sg-dock { display: flex !important; bottom: 0 !important; height: 25% !important; left: 0 !important; right: 0 !important; z-index: 20 !important; }
  #sg-games .sg-rack { display: flex !important; flex: 1 1 auto !important; min-width: 0 !important; min-height: 96px !important; visibility: visible !important; }
  #sg-games .sg-rack-row { display: grid !important; grid-auto-flow: column !important; grid-auto-columns: minmax(0, 1fr) !important; align-items: center !important; min-height: 0 !important; }
  #sg-games .sg-rack-row .sg-tile,
  #sg-games .sg-rack-row .sg-rack-slot { width: 100% !important; height: auto !important; aspect-ratio: 1 / 1.34 !important; min-width: 0 !important; }
  #sg-games .sg-rack-brand { min-height: 24px !important; }
}


/* Stable video-style chat composer. */
#sg-games .sg-chat-panel { z-index: 60; display: flex; flex-direction: column; }
#sg-games .sg-chat-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
#sg-games .sg-chat-form { display: flex !important; align-items: center; gap: 8px; flex: 0 0 auto; }
#sg-games .sg-chat-form input { flex: 1 1 auto; min-width: 0; height: 38px; color: #fff; background: rgba(255,255,255,.10); }
#sg-games .sg-chat-form button { flex: 0 0 auto; min-width: 66px; height: 38px; }
@media (max-width: 720px) and (orientation: portrait) {
  #sg-games .sg-table-wrap { bottom: 27% !important; }
  #sg-games .sg-dock { height: 25% !important; }
  #sg-games .sg-rack { min-height: 96px !important; }
  #sg-games .sg-message-fab { bottom: 26% !important; }
}


/* Exact reference portrait proportions. */
@media (max-width: 720px) and (orientation: portrait) {
  #sg-games .sg-table-wrap { bottom: 14% !important; }
  #sg-games .sg-dock { height: 14% !important; min-height: 112px !important; }
  #sg-games .sg-rack { min-height: 84px !important; padding: 5px 4px !important; }
  #sg-games .sg-rack-brand { min-height: 16px !important; }
  #sg-games .sg-message-fab { bottom: 15% !important; }
  #sg-games .sg-chat-panel { width: min(390px, 78vw) !important; }
}


/* Remove side + OTUR strips. */
#sg-games .sg-dock > .sg-side,
#sg-games .sg-side-left,
#sg-games .sg-side-right { display: none !important; }
#sg-games .sg-dock { gap: 0 !important; }
#sg-games .sg-rack { flex: 1 1 100% !important; width: 100% !important; }

/* Keep the lower player seat above the shorter rack on phones. */
@media (max-width: 720px) and (orientation: portrait) {
  #sg-games .sg-table-wrap { bottom: 12% !important; }
  #sg-games .sg-dock { height: 12% !important; min-height: 90px !important; }
  #sg-games .sg-rack { min-height: 72px !important; padding: 4px 3px !important; }
  #sg-games .sg-rack-brand { min-height: 10px !important; }
  #sg-games .sg-message-fab { bottom: 13% !important; }
}


/* Compact portrait tile geometry. */
@media (max-width: 720px) and (orientation: portrait) {
  #sg-games .sg-rack-row {
    display: flex !important; justify-content: center !important; align-items: center !important;
    gap: 1px !important; overflow: hidden !important;
  }
  #sg-games .sg-rack-row .sg-tile,
  #sg-games .sg-rack-row .sg-rack-slot {
    flex: 0 0 clamp(18px, 5.8vw, 25px) !important;
    width: clamp(18px, 5.8vw, 25px) !important;
    height: clamp(24px, 7.8vw, 34px) !important;
    min-width: 0 !important; aspect-ratio: auto !important;
  }
  #sg-games .sg-rack { overflow: hidden !important; }
}


/* Hide discard action from rack. */
#sg-games .sg-rack [data-action="discard"],
#sg-games .sg-rack [data-action="discard-tile"],
#sg-games .sg-rack .sg-act[aria-label*="Taş at"] { display: none !important; }

/* Video layout: sorting controls, not empty-seat strips. */
#sg-games .sg-dock > .sg-side,
#sg-games .sg-side-left,
#sg-games .sg-side-right {
  display: flex !important;
  position: relative;
  z-index: 22;
  flex: 0 0 auto !important;
  width: clamp(52px, 6vw, 84px) !important;
  height: auto;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffe49a, #d79726 58%, #9a5a10) !important;
  color: #2b1804 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 3px 8px rgba(0,0,0,.5) !important;
}
#sg-games .sg-side span { font-size: clamp(9px, 1.05vw, 14px) !important; color: #2b1804 !important; }
#sg-games .sg-side span::after { content: none !important; display: none !important; }
#sg-games .sg-side-art { display: none !important; }

/* In portrait, the pair button is top-left and serial sorting is top-right. */
@media (max-width: 720px) and (orientation: portrait) {
  #sg-games .sg-dock { position: absolute; }
  #sg-games .sg-dock > .sg-side-left {
    display: none !important;
  }
  #sg-games .sg-dock > .sg-side-right {
    position: absolute !important;
    top: -30px !important;
    right: 2px !important;
    width: 58px !important;
    height: 25px !important;
    min-height: 0 !important;
    font-size: 9px !important;
  }
  #sg-games .sg-pairs-go {
    left: 2px !important;
    right: auto !important;
    bottom: 13.5% !important;
    padding: 4px 7px !important;
    font-size: 9px !important;
    z-index: 24 !important;
  }
}

/* In landscape, the two sorting controls sit on the rack's left and right. */
@media (min-width: 721px), (orientation: landscape) {
  #sg-games .sg-dock > .sg-side-left,
  #sg-games .sg-dock > .sg-side-right {
    position: relative !important;
  }
  #sg-games .sg-pairs-go { display: none !important; }
}

/* Sort controls are visible and usable only after the round starts. */
#sg-games .sg-dock > .sg-side-left,
#sg-games .sg-dock > .sg-side-right { display: none !important; }
#sg-games.sg-playing .sg-dock > .sg-side-left,
#sg-games.sg-playing .sg-dock > .sg-side-right { display: flex !important; }

/* Portrait reference: ÇİFT DİZ left and SERİ DİZ right above the rack. */
@media (max-width: 720px) and (orientation: portrait) {
  #sg-games .sg-pairs-go { display: none !important; }
  #sg-games.sg-playing .sg-dock > .sg-side-left {
    display: flex !important;
    position: absolute !important;
    top: -30px !important;
    left: 2px !important;
    width: 58px !important;
    height: 25px !important;
    min-height: 0 !important;
    font-size: 9px !important;
  }
  #sg-games.sg-playing .sg-dock > .sg-side-right {
    display: flex !important;
    position: absolute !important;
    top: -30px !important;
    right: 2px !important;
    width: 58px !important;
    height: 25px !important;
    min-height: 0 !important;
    font-size: 9px !important;
  }
}

/* Portrait reference: draw pile and active tiles stay in the table center. */
@media (max-width: 720px) and (orientation: portrait) {
  #sg-games .sg-stock {
    left: 50% !important;
    right: auto !important;
    top: 52% !important;
    transform: translate(-50%, -50%) !important;
  }
  #sg-games .sg-seat-self {
    bottom: 0 !important;
    transform: translate(-50%, -100%) !important;
    z-index: 30 !important;
  }
  #sg-games .sg-table-wrap { overflow: visible !important; }
}

/* Video reference: chat envelope sits beside the user's own name plate. */
#sg-games .sg-message-fab {
  right: auto !important;
  left: calc(50% + clamp(62px, 8vw, 108px)) !important;
  bottom: 14% !important;
  width: 34px !important;
  height: 34px !important;
  z-index: 35 !important;
}
@media (max-width: 720px) and (orientation: portrait) {
  #sg-games .sg-message-fab {
    left: calc(50% + 54px) !important;
    bottom: 13% !important;
    width: 31px !important;
    height: 31px !important;
  }
}

/* Final video match: self nickname touches the rack's upper edge. */
#sg-games .sg-seat-self { transform: translate(-50%, 0) !important; }
#sg-games .sg-chat-head strong { display: inline-flex; align-items: center; gap: 8px; }
#sg-games .sg-chat-title-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
#sg-games .sg-chat-panel { top: 68px !important; right: 0 !important; bottom: 0 !important; }
@media (max-width: 720px) and (orientation: portrait) {
  #sg-games .sg-seat-self { transform: translate(-50%, 0) !important; }
  #sg-games .sg-message-fab {
    left: 65% !important;
    right: auto !important;
    top: 74% !important;
    bottom: auto !important;
  }
  #sg-games .sg-chat-panel { width: 62vw !important; min-width: 0 !important; }
}

/* Correct final seat alignment: the name plate stays above, never inside, the rack. */
@media (max-width: 720px) and (orientation: portrait) {
  #sg-games .sg-seat-self {
    bottom: 1.8vh !important;
    transform: translate(-50%, 0) !important;
    z-index: 40 !important;
  }
  #sg-games .sg-message-fab {
    left: 65% !important;
    top: auto !important;
    bottom: calc(12% + 1.8vh) !important;
    z-index: 41 !important;
  }
  #sg-games .sg-chat-panel {
    top: 68px !important;
    bottom: 0 !important;
    width: 62vw !important;
    background: #292b2f !important;
  }
  #sg-games .sg-chat-head { background: #202226 !important; }
  #sg-games .sg-chat-list { background: #292b2f !important; }
  #sg-games .sg-chat-form { background: #202226 !important; }
  #sg-games .sg-chat-form input { background: #3a3d42 !important; color: #fff !important; }
  #sg-games .sg-chat-form button { background: #2f8b57 !important; color: #fff !important; }
}

/* Video chat composer proportions: wide message field, compact Send button. */
#sg-games .sg-chat-form { display: flex !important; gap: 6px !important; padding: 9px 10px !important; }
#sg-games .sg-chat-form input {
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 0 !important;
  height: 42px !important;
  padding: 10px 13px !important;
  font-size: 13px !important;
}
#sg-games .sg-chat-form button {
  flex: 0 0 58px !important;
  width: 58px !important;
  min-width: 58px !important;
  height: 36px !important;
  padding: 6px 5px !important;
  font-size: 10px !important;
  line-height: 1 !important;
  border-radius: 7px !important;
}
@media (max-width: 720px) and (orientation: portrait) {
  #sg-games .sg-chat-form { gap: 5px !important; padding: 9px 8px !important; }
  #sg-games .sg-chat-form input { height: 44px !important; font-size: 12px !important; }
  #sg-games .sg-chat-form button { flex-basis: 54px !important; width: 54px !important; min-width: 54px !important; height: 34px !important; font-size: 9px !important; }
}

/* Keep mobile chat fixed while the virtual keyboard opens. */
#sg-games .sg-chat-panel {
  position: fixed !important;
  top: 68px !important;
  right: 0 !important;
  bottom: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow: hidden !important;
  overscroll-behavior: contain !important;
  transform: translateZ(0);
}
#sg-games .sg-chat-list { overscroll-behavior: contain !important; }
#sg-games .sg-chat-form input { scroll-margin: 0 !important; }
@media (max-width: 720px) and (orientation: portrait) {
  #sg-games .sg-chat-panel {
    height: calc(100svh - 68px) !important;
    max-height: calc(100svh - 68px) !important;
  }
  #sg-games .sg-chat-form { position: relative !important; z-index: 2 !important; }
}

/* The self plate is paired with the chat envelope, not extra status controls. */
#sg-games .sg-seat-self .sg-mic,
#sg-games .sg-seat-self .sg-turn-chip { display: none !important; }

/* Video reference: timer on the plate corner and score directly underneath. */
#sg-games .sg-seat-self .sg-plate { position: relative !important; }
#sg-games .sg-seat-self .sg-timer { right: -7px !important; top: -7px !important; transform: none !important; z-index: 3 !important; }
#sg-games .sg-score-chip { position: absolute; left: 50%; bottom: -23px; transform: translateX(-50%); padding: 3px 9px; border-radius: 999px; background: linear-gradient(180deg,#ffe28a,#d89e2b); color:#2b1b08; box-shadow:0 3px 8px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.65); font:700 10px/1 'Trebuchet MS',sans-serif; white-space:nowrap; z-index:3; }
@media (max-width:720px) and (orientation:portrait) { #sg-games .sg-score-chip { bottom:-21px; font-size:9px; padding:3px 8px; } }

/* Demo eşleşmesi: mobilde aktif oyuncunun geri sayımı gizlenmez. */
@media (max-width: 720px) {
  #sg-games.sg-playing .sg-timer { display: grid !important; }
}
@media (max-width: 720px) and (max-height: 520px) {
  #sg-games.sg-playing .sg-timer { display: grid !important; width: 24px; font-size: 10px; }
}

/* Demo gibi: dört oyuncunun discard yığını görünür, yalnız sıra yönündeki
   önceki oyuncunun yığını alınabilir kalır. */
#sg-games .sg-piles .sg-observed-pile {
  right: auto !important;
  transform: translate(-50%, -50%) !important;
  z-index: 4;
}
#sg-games .sg-piles .sg-observed-pile[aria-disabled="true"] {
  opacity: .82;
  pointer-events: none;
}
#sg-games .sg-piles .sg-observed-pile.sg-takeable { z-index: 6; }

/* Demo eşleşmesi: sayaç nick satırının içinde, küçük ve nickten ayrı durur. */
#sg-games .sg-name-line { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
#sg-games .sg-name-line .sg-timer { position: static !important; transform: none !important; display: inline-grid !important; flex: 0 0 20px; width: 20px; height: 20px; aspect-ratio: auto; font-size: 9px; line-height: 1; box-shadow: inset 0 0 0 1px rgba(255,215,106,.75), 0 2px 5px rgba(0,0,0,.5); }
#sg-games .sg-name-line b { max-width: 11ch; overflow: hidden; text-overflow: ellipsis; }
#sg-games .sg-piles .sg-observed-pile .sg-pile-tile .sg-tile { --sg-tw: calc(var(--sg-base) * .72); opacity: .96; }
@media (max-width:720px) { #sg-games .sg-name-line .sg-timer { flex-basis:18px; width:18px; height:18px; font-size:8px; } #sg-games .sg-name-line b { max-width:9ch; } }

/* Puan demo gibi nickin hemen altında, oyuncu etiketinin normal akışında kalır. */
#sg-games .sg-seat-self .sg-score-chip { position: static !important; display: inline-block; transform: none !important; margin-top: 2px; padding: 2px 6px; font-size: 9px; line-height: 1.1; }
#sg-games .sg-seat-self .sg-plate-text { align-items: flex-start; }
@media (max-width:720px) { #sg-games .sg-seat-self .sg-score-chip { font-size: 8px; padding: 2px 5px; margin-top: 1px; } }

/* Oyuncu koltukları demo kenar yerleşimi: 3/4 oyuncu merkezde karşı karşıya kalmaz. */
#sg-games .sg-seat-top { left: 50% !important; top: 2% !important; transform: translate(-50%, 0) !important; }
#sg-games .sg-seat-left { left: 1.5% !important; right: auto !important; top: 50% !important; transform: translateY(-50%) !important; }
#sg-games .sg-seat-right { right: 1.5% !important; left: auto !important; top: 50% !important; transform: translateY(-50%) !important; }
#sg-games .sg-seat-self { left: 50% !important; right: auto !important; bottom: 1.5% !important; top: auto !important; transform: translate(-50%, 0) !important; }
@media (max-width:720px) {
  #sg-games .sg-seat-left { left: 0 !important; top: 50% !important; }
  #sg-games .sg-seat-right { right: 0 !important; top: 50% !important; }
  #sg-games .sg-seat-top { top: 1% !important; }
  #sg-games .sg-seat-self { bottom: 1.8vh !important; }
}

/* Gerçek profil fotoğrafı nick plakasında kullanılır. */
#sg-games .sg-avatar { overflow: hidden; }
#sg-games .sg-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 50%; }
#sg-games .sg-avatar img + span[hidden] { display: none !important; }
/* Atma hedefi sağ oyuncunun hizasında, discard yığınının yanında. */
#sg-games .sg-discard-drop { right: 4%; top: 78%; transform: translateY(-50%); }

/* Gösterge ve orta deste demo merkezi: ikisi masanın ortasında yan yana. */
#sg-games .sg-indicator { left: 42% !important; top: 50% !important; transform: translate(-50%, -50%) !important; }
#sg-games .sg-stock { left: 58% !important; right: auto !important; top: 50% !important; transform: translate(-50%, -50%) !important; }
@media (max-width:720px) {
  #sg-games .sg-indicator { left: 42% !important; top: 50% !important; }
  #sg-games .sg-stock { left: 58% !important; top: 50% !important; right: auto !important; }
}

/* Demo iskarta etiketsiz görünüm */
#sg-games .sg-piles .sg-pile-owner, #sg-games .sg-piles .sg-take-label { display:none !important; }

/* Discard taşı gövdesi: sayı tek başına kalmasın, demo ıskarta taşı tamamen görünsün. */
#sg-games .sg-piles .sg-pile-tile { display: block !important; line-height: 0 !important; }
#sg-games .sg-piles .sg-pile-tile > .sg-tile { display: block !important; position: relative !important; width: var(--sg-tw) !important; height: calc(var(--sg-tw) * 1.34) !important; padding: 0 !important; border: 0 !important; border-radius: calc(var(--sg-tw) * .16) !important; background: linear-gradient(90deg, rgba(255,255,255,.92), transparent 16%), linear-gradient(180deg, #fffef9 0%, #fffdf4 74%, #ddd9ce 100%) !important; box-shadow: inset 0 1px 0 rgba(255,255,255,.95), inset 0 -2px 0 rgba(176,164,136,.55), inset 0 0 0 1px rgba(196,186,160,.65), 0 2px 3px rgba(0,0,0,.45) !important; }
#sg-games .sg-piles .sg-pile-tile > .sg-tile > .sg-face { display: flex !important; width: 100% !important; height: 100% !important; align-items: center !important; justify-content: center !important; }

/* Demo tipi sıralamada per blokları yatay bütünlüğünü korur. */
#sg-games .sg-rack-group { display:inline-flex; align-items:center; gap:1px; flex:0 0 auto; margin:0 3px; }
@media (max-width:720px) and (orientation:portrait) {
  #sg-games .sg-rack-group { gap:1px; margin:0 1px; }
}
/* Demo salonu: masa kartları, dört koltuk ve ayar formu. */
#sg-games .sg-lobby-inner { max-width:1120px; margin:0 auto; padding:clamp(18px,4vw,42px); }
#sg-games .sg-lobby-head { display:flex; align-items:center; gap:16px; padding:14px 0 22px; border-bottom:1px solid rgba(255,224,145,.18); }
#sg-games .sg-lobby-head > div { flex:1; min-width:0; }
#sg-games .sg-lobby-head h1 { margin:0; color:#ffe49a; font-size:clamp(21px,3vw,34px); }
#sg-games .sg-lobby-head p { margin:5px 0 0; color:rgba(255,255,255,.66); }
#sg-games .sg-table-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:16px; padding-top:22px; }
#sg-games .sg-table-card { overflow:hidden; border:1px solid rgba(255,220,140,.25); border-radius:16px; background:linear-gradient(145deg,rgba(39,78,56,.96),rgba(11,29,24,.98)); box-shadow:0 10px 24px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.08); }
#sg-games .sg-table-card > header, #sg-games .sg-table-card > footer { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:12px 14px; }
#sg-games .sg-table-card > header { background:rgba(0,0,0,.16); color:#ffe49a; }
#sg-games .sg-table-card > footer { color:rgba(255,255,255,.68); font-size:11px; border-top:1px solid rgba(255,255,255,.08); }
#sg-games .sg-mini-table { position:relative; min-height:142px; margin:0 12px; border-radius:50%; background:radial-gradient(ellipse,#2c8a5a 0%,#16623e 62%,#0e402d 100%); border:8px solid #7d481b; box-shadow:inset 0 0 0 2px #d99b39, 0 5px 12px rgba(0,0,0,.35); }
#sg-games .sg-mini-center { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); color:#ffe49a; font-weight:800; letter-spacing:1px; }
#sg-games .sg-mini-seat { position:absolute; display:flex; flex-direction:column; align-items:center; gap:2px; color:rgba(255,255,255,.7); font-size:9px; }
#sg-games .sg-mini-seat:nth-of-type(2){left:50%;top:5%;transform:translateX(-50%)}
#sg-games .sg-mini-seat:nth-of-type(3){right:4%;top:50%;transform:translateY(-50%)}
#sg-games .sg-mini-seat:nth-of-type(4){left:50%;bottom:3%;transform:translateX(-50%)}
#sg-games .sg-mini-seat:nth-of-type(5){left:4%;top:50%;transform:translateY(-50%)}
#sg-games .sg-mini-seat i { display:grid; place-items:center; width:28px; height:28px; border-radius:50%; color:#40250c; font-style:normal; font-weight:800; background:linear-gradient(#ffe9a7,#d9962c); border:2px solid rgba(255,255,255,.7); }
#sg-games .sg-mini-seat:not(.sg-taken) i { background:rgba(0,0,0,.2); color:#ffe49a; border-style:dashed; }
#sg-games .sg-create-form { display:grid; gap:12px; }
#sg-games .sg-create-form label { display:grid; gap:5px; color:#ffe49a; font-weight:700; }
#sg-games .sg-create-form select { min-height:40px; border:1px solid rgba(255,220,140,.35); border-radius:8px; padding:0 10px; background:#17392b; color:#fff; }
#sg-games .sg-chat-readonly { margin:0; padding:12px; color:rgba(255,255,255,.7); text-align:center; font-size:12px; }
@media (max-width:720px) { #sg-games .sg-lobby-head { flex-wrap:wrap; } #sg-games .sg-lobby-head > div { order:-1; flex-basis:100%; } #sg-games .sg-lobby-head .sg-back { order:1; } #sg-games .sg-lobby-head > .sg-btn-primary { order:2; } #sg-games .sg-lobby-inner { padding:16px 12px; } }


/* Demo taş görselleri: Çift Diz / Seri Diz ve merkez deste-gösterge */
#sg-games .sg-dock > .sg-side .sg-side-art { display:flex !important; gap:2px !important; align-items:center !important; justify-content:center !important; margin-top:3px !important; }
#sg-games .sg-dock > .sg-side .sg-side-art b { display:grid !important; place-items:center !important; width:12px !important; height:16px !important; border-radius:3px !important; background:linear-gradient(90deg,#fffef8 0%,#fffdf2 76%,#d9d1bd 100%) !important; border:1px solid rgba(120,80,25,.7) !important; box-shadow:inset 0 1px 0 #fff,0 1px 2px rgba(0,0,0,.45) !important; font:800 11px/1 Arial,sans-serif !important; text-shadow:none !important; }
#sg-games .sg-dock > .sg-side .sg-side-art .sg-mini-red { color:#c4202b !important; }
#sg-games .sg-dock > .sg-side .sg-side-art .sg-mini-blue { color:#1e4ba8 !important; }
#sg-games .sg-dock > .sg-side .sg-side-art .sg-mini-gold { color:#c48605 !important; }
#sg-games .sg-indicator { z-index:12 !important; min-width:clamp(48px,6vw,72px) !important; min-height:clamp(66px,8.5vw,96px) !important; padding:5px !important; border-radius:8px !important; background:rgba(45,25,8,.45) !important; box-shadow:0 4px 14px rgba(0,0,0,.45),inset 0 0 0 1px rgba(255,228,154,.24) !important; }
#sg-games .sg-indicator .sg-ind-label { display:block !important; margin-bottom:3px !important; color:#ffe49a !important; font-size:clamp(8px,1vw,11px) !important; font-weight:800 !important; letter-spacing:.04em !important; text-align:center !important; }
#sg-games .sg-indicator .sg-ind-tile { display:flex !important; justify-content:center !important; }
#sg-games .sg-indicator .sg-ind-tile .sg-tile { width:clamp(30px,4vw,48px) !important; height:clamp(42px,5.4vw,64px) !important; font-size:clamp(18px,2.4vw,28px) !important; }
#sg-games .sg-stock { z-index:12 !important; min-width:clamp(48px,6vw,72px) !important; min-height:clamp(66px,8.5vw,96px) !important; padding:5px !important; border-radius:8px !important; background:rgba(45,25,8,.45) !important; box-shadow:0 4px 14px rgba(0,0,0,.45),inset 0 0 0 1px rgba(255,228,154,.24) !important; }
#sg-games .sg-stock .sg-stack { transform:scale(.92) !important; filter:drop-shadow(0 3px 3px rgba(0,0,0,.45)); }
#sg-games .sg-stock .sg-stock-meta { position:relative !important; z-index:2 !important; margin-top:2px !important; }
@media (max-width:720px) and (orientation:portrait) {
  #sg-games .sg-dock > .sg-side .sg-side-art b { width:9px !important; height:12px !important; font-size:8px !important; }
  #sg-games .sg-indicator,#sg-games .sg-stock { min-width:42px !important; min-height:58px !important; padding:3px !important; }
  #sg-games .sg-indicator .sg-ind-tile .sg-tile { width:27px !important; height:38px !important; font-size:16px !important; }
  #sg-games .sg-indicator .sg-ind-label { font-size:7px !important; }
}


/* Demo referansı: alt raftaki ÇİFTDİZ / SERİDİZ butonları */
#sg-games .sg-dock > .sg-side { flex-direction:row !important; align-items:center !important; justify-content:center !important; gap:6px !important; width:clamp(116px,12vw,148px) !important; height:40px !important; min-height:34px !important; padding:4px 8px !important; border:2px solid #efbd4d !important; border-radius:8px !important; background:linear-gradient(180deg,#87551d 0%,#4b250b 100%) !important; box-shadow:inset 0 1px 0 rgba(255,242,170,.75),0 2px 5px rgba(0,0,0,.7) !important; }
#sg-games .sg-dock > .sg-side .sg-side-art { flex:0 0 auto !important; margin:0 !important; gap:2px !important; }
#sg-games .sg-dock > .sg-side .sg-side-art b { width:18px !important; height:22px !important; border:1px solid #a8c5e9 !important; border-radius:2px !important; background:linear-gradient(#fff,#e9edf3) !important; color:#1c5ea8 !important; font:800 14px/1 Arial,sans-serif !important; }
#sg-games .sg-dock > .sg-side span { color:#fff !important; font-size:clamp(10px,1.2vw,15px) !important; font-weight:900 !important; letter-spacing:-.03em !important; white-space:nowrap !important; text-shadow:0 1px 2px #241102 !important; }
@media (max-width:720px) and (orientation:portrait) {
 #sg-games .sg-dock > .sg-side-left,#sg-games .sg-dock > .sg-side-right { width:116px !important; height:32px !important; top:-37px !important; gap:4px !important; padding:3px 5px !important; }
 #sg-games .sg-dock > .sg-side .sg-side-art b { width:15px !important; height:19px !important; font-size:12px !important; }
 #sg-games .sg-dock > .sg-side span { font-size:11px !important; }
}


/* Demo: taş ikonları düğmenin kendi içeriğinde kalır */
#sg-games .sg-dock > .sg-side { display:inline-flex !important; box-sizing:border-box !important; overflow:hidden !important; }
#sg-games .sg-dock > .sg-side .sg-side-art { display:inline-flex !important; position:static !important; visibility:visible !important; opacity:1 !important; flex:0 0 auto !important; align-items:center !important; justify-content:center !important; }
#sg-games .sg-dock > .sg-side .sg-side-art b { display:inline-grid !important; position:static !important; flex:0 0 auto !important; }
#sg-games .sg-dock > .sg-side > span { display:inline-block !important; position:static !important; flex:0 0 auto !important; }
@media (max-width:720px) and (orientation:portrait) {
 #sg-games .sg-dock > .sg-side-left,#sg-games .sg-dock > .sg-side-right { overflow:hidden !important; }
 #sg-games .sg-dock > .sg-side-left .sg-side-art,#sg-games .sg-dock > .sg-side-right .sg-side-art { display:inline-flex !important; }
}


/* Portrait final alignment: buttons sit above the rack like the demo */
@media (max-width:720px) and (orientation:portrait) {
 #sg-games .sg-dock { left:0 !important; right:0 !important; bottom:0 !important; height:15% !important; min-height:112px !important; padding:0 !important; display:block !important; z-index:40 !important; }
 #sg-games .sg-dock > .sg-side-left,#sg-games .sg-dock > .sg-side-right { display:inline-flex !important; position:absolute !important; top:-39px !important; bottom:auto !important; width:116px !important; height:32px !important; min-height:32px !important; max-height:32px !important; margin:0 !important; }
 #sg-games .sg-dock > .sg-side-left { left:18px !important; right:auto !important; }
 #sg-games .sg-dock > .sg-side-right { right:18px !important; left:auto !important; }
 #sg-games .sg-rack { position:absolute !important; left:3px !important; right:3px !important; top:0 !important; bottom:0 !important; width:auto !important; min-height:84px !important; height:auto !important; }
 #sg-games .sg-rack-row .sg-tile { max-height:34px !important; }
 #sg-games .sg-message-fab { bottom:16% !important; }
}


/* Demo button icons use real miniature tile faces, not plain numerals */
#sg-games .sg-side-art .sg-tile { display:inline-flex !important; width:18px !important; height:22px !important; min-width:18px !important; padding:0 !important; margin:0 !important; border-radius:3px !important; font-size:12px !important; border:1px solid rgba(45,90,150,.55) !important; box-shadow:0 1px 2px rgba(0,0,0,.5) !important; }
#sg-games .sg-side-art .sg-tile .sg-face { display:flex !important; align-items:center !important; justify-content:center !important; width:100% !important; height:100% !important; }
#sg-games .sg-side-art { gap:2px !important; }
@media (max-width:720px) and (orientation:portrait) {
 #sg-games .sg-side-art .sg-tile { width:15px !important; min-width:15px !important; height:19px !important; font-size:10px !important; }
}

/* Demo merkez taşları: iki bağımsız taş, etiketsiz gösterge ve siyah sayaç rozeti */
#sg-games .sg-indicator,#sg-games .sg-stock { padding:0 !important; min-width:0 !important; min-height:0 !important; border-radius:0 !important; background:transparent !important; box-shadow:none !important; gap:0 !important; }
#sg-games .sg-indicator .sg-ind-label,#sg-games .sg-stock .sg-stock-meta,#sg-games .sg-stock .sg-stock-hint { display:none !important; }
#sg-games .sg-indicator .sg-ind-tile .sg-tile { width:42px !important; height:58px !important; font-size:25px !important; border-radius:5px !important; box-shadow:0 2px 4px rgba(0,0,0,.55) !important; }
#sg-games .sg-stock .sg-stack { width:42px !important; height:58px !important; }
#sg-games .sg-stock .sg-stack i { border-radius:5px !important; background:linear-gradient(180deg,#fffefb,#eeeae0) !important; box-shadow:0 2px 4px rgba(0,0,0,.55),inset 0 0 0 1px rgba(170,160,140,.45) !important; }
#sg-games .sg-stock .sg-stack i::after { display:none !important; }
#sg-games .sg-stock .sg-stock-count { position:absolute !important; right:-17px !important; top:-12px !important; z-index:4 !important; display:grid !important; place-items:center !important; width:34px !important; height:34px !important; border-radius:50% !important; background:#080b0b !important; color:#fff !important; font:800 16px/1 Arial,sans-serif !important; box-shadow:0 2px 3px rgba(0,0,0,.5) !important; }
@media (max-width:720px) and (orientation:portrait) {
 #sg-games .sg-indicator .sg-ind-tile .sg-tile,#sg-games .sg-stock .sg-stack { width:32px !important; height:44px !important; }
 #sg-games .sg-indicator .sg-ind-tile .sg-tile { font-size:19px !important; }
 #sg-games .sg-stock .sg-stock-count { right:-14px !important; top:-10px !important; width:28px !important; height:28px !important; font-size:13px !important; }
}
/* Portrait: full demo button content must remain visible */
@media (max-width:720px) and (orientation:portrait) {
  #sg-games .sg-dock > .sg-side-left,
  #sg-games .sg-dock > .sg-side-right {
  }
}

@media (max-width:720px) and (orientation:portrait) {
  #sg-games .sg-dock > .sg-side-left,
  #sg-games .sg-dock > .sg-side-right {
    width:140px !important; height:36px !important; min-width:140px !important; min-height:36px !important; max-height:36px !important; padding:3px 7px !important; gap:5px !important; white-space:nowrap !important;
  }
  #sg-games .sg-dock > .sg-side-left { left:8px !important; }
  #sg-games .sg-dock > .sg-side-right { right:8px !important; }
  #sg-games .sg-dock > .sg-side > span { font-size:12px !important; letter-spacing:-.04em !important; }
  #sg-games .sg-dock > .sg-side .sg-side-art { flex:0 0 auto !important; gap:2px !important; }
  #sg-games .sg-dock > .sg-side .sg-side-art .sg-tile { width:17px !important; min-width:17px !important; height:22px !important; font-size:11px !important; }
}

/* Portrait demo proportions: compact sort buttons, chat stays unobstructed */
@media (max-width:720px) and (orientation:portrait) {
  #sg-games .sg-dock > .sg-side-left,
  #sg-games .sg-dock > .sg-side-right {
    width:108px !important; min-width:108px !important; height:32px !important; min-height:32px !important; max-height:32px !important; padding:2px 5px !important; gap:4px !important; top:-35px !important; z-index:42 !important;
  }
  #sg-games .sg-dock > .sg-side-left { left:5px !important; }
  #sg-games .sg-dock > .sg-side-right { right:5px !important; }
  #sg-games .sg-dock > .sg-side > span { font-size:10px !important; letter-spacing:-.04em !important; }
  #sg-games .sg-dock > .sg-side .sg-side-art .sg-tile { width:14px !important; min-width:14px !important; height:19px !important; font-size:9px !important; }
  #sg-games .sg-message-fab { bottom:16% !important; z-index:70 !important; }
  #sg-games .sg-seat-self { z-index:55 !important; }
}

/* Portrait: the self nick plate is fully above the rack, never inside it */
@media (max-width:720px) and (orientation:portrait) {
  #sg-games .sg-table-wrap { bottom:15% !important; }
  #sg-games .sg-seat-self { bottom:0 !important; transform:translate(-50%,-100%) !important; z-index:60 !important; }
  #sg-games .sg-seat-self .sg-plate { position:relative !important; z-index:61 !important; }
  #sg-games .sg-message-fab { bottom:15% !important; z-index:70 !important; }
}

/* Portrait: close the gap between the self plate and the rack */
@media (max-width:720px) and (orientation:portrait) {
  #sg-games .sg-seat-self { transform:translate(-50%,calc(-100% + 30px)) !important; }
  #sg-games .sg-message-fab { bottom:calc(15% + 2px) !important; }
}

/* Demo masa yüzeyi: koyu zümrüt çuha, hafif baklava dokusu ve ahşap raylar */
#sg-games .sg-table { background:linear-gradient(180deg,#a66a32 0%,#713c1b 18%,#482512 62%,#29170c 100%) !important; box-shadow:inset 0 2px 0 rgba(255,220,160,.26),0 6px 16px rgba(0,0,0,.62) !important; }
#sg-games .sg-felt { background:radial-gradient(125% 85% at 50% 16%,#087f56 0%,#056642 56%,#013d29 100%) !important; }
#sg-games .sg-felt::before { background-image:linear-gradient(45deg,rgba(255,255,255,.035) 25%,transparent 25%,transparent 75%,rgba(255,255,255,.035) 75%),linear-gradient(45deg,rgba(255,255,255,.035) 25%,transparent 25%,transparent 75%,rgba(255,255,255,.035) 75%) !important; background-position:0 0,9px 9px !important; background-size:18px 18px !important; opacity:.22 !important; mix-blend-mode:screen !important; }
#sg-games .sg-felt::after { opacity:.42 !important; }
#sg-games .sg-table-wrap::before,#sg-games .sg-table-wrap::after { top:16% !important; bottom:24% !important; width:9px !important; background:linear-gradient(90deg,#6c3b1d 0%,#bd7b39 45%,#70401f 100%) !important; box-shadow:0 0 7px rgba(0,0,0,.65),inset 0 1px 0 rgba(255,220,160,.28) !important; }
#sg-games .sg-rack { background:linear-gradient(180deg,#c8873e 0%,#a45d25 12%,#7d4016 52%,#5e2d0e 82%,#8b4b1d 100%) !important; box-shadow:0 20px 42px rgba(0,0,0,.7),inset 0 2px 0 rgba(255,220,170,.45),inset 0 -8px 16px rgba(0,0,0,.56) !important; }

/* Demo chat header: white dice game symbol before Masa Sohbeti */
#sg-games .sg-chat-head strong { display:inline-flex !important; align-items:center !important; gap:8px !important; }
#sg-games .sg-chat-head .sg-chat-title-icon { display:none !important; }
#sg-games .sg-chat-head strong::before { content:'🎲' !important; display:inline-block !important; width:23px !important; height:23px !important; font-size:22px !important; line-height:23px !important; filter:grayscale(1) brightness(1.35) !important; }

/* Demo Oyunlar button: trophy icon, not chess rook */
#sg-games .sg-hud-left::before { content:'🏆' !important; display:grid !important; place-items:center !important; font-size:22px !important; line-height:1 !important; color:#704b08 !important; filter:grayscale(.15) saturate(.8) !important; }

/* Chat/game HUD reference: gold game button carries the 101 label */
#sg-games .sg-hud-left::before { content:'101' !important; display:grid !important; place-items:center !important; width:40px !important; height:40px !important; border-radius:8px !important; background:linear-gradient(145deg,#ffe89a,#e9aa2e) !important; color:#704b08 !important; font:900 16px/1 Arial,sans-serif !important; letter-spacing:-.04em !important; filter:none !important; text-shadow:0 1px 0 rgba(255,255,255,.35) !important; }

/* Demo top bar: minimize dash sits immediately beside close */
#sg-games .sg-hud-minimize { display:grid !important; place-items:center !important; width:40px !important; height:40px !important; padding:0 !important; color:#e7e7e7 !important; background:transparent !important; border:0 !important; font:700 28px/1 Arial,sans-serif !important; }
#sg-games .sg-hud-minimize:hover { background:rgba(255,255,255,.08) !important; }
#sg-games.sg-min .sg-hud-minimize { display:none !important; }
/* Setgon salon reference: compact green felt table lobby */
#sg-games .sg-lobby {
  background:radial-gradient(ellipse at 50% 22%,rgba(5,125,78,.22),transparent 54%),#061713 !important;
  overflow:auto !important;
}
#sg-games .sg-lobby::before {
  content:''; position:absolute; inset:0; pointer-events:none; opacity:.2;
  background-image:linear-gradient(45deg,rgba(255,255,255,.035) 25%,transparent 25%,transparent 75%,rgba(255,255,255,.035) 75%),linear-gradient(45deg,rgba(255,255,255,.035) 25%,transparent 25%,transparent 75%,rgba(255,255,255,.035) 75%);
  background-position:0 0,9px 9px; background-size:18px 18px;
}
#sg-games .sg-lobby-inner { position:relative; z-index:1; max-width:1040px !important; padding:clamp(74px,10vh,104px) clamp(12px,3vw,34px) 28px !important; }
#sg-games .sg-lobby-head { position:sticky; top:0; z-index:4; margin:0 -2px 14px; padding:10px 0 14px !important; background:rgba(4,17,14,.92); border-bottom:1px solid rgba(255,214,104,.22) !important; backdrop-filter:blur(8px); }
#sg-games .sg-lobby-head h1 { color:#fff !important; font-size:clamp(20px,3vw,30px) !important; text-shadow:0 2px 6px #000; }
#sg-games .sg-lobby-head p { color:#b8d2c9 !important; }
#sg-games .sg-lobby-head .sg-back { border:1px solid rgba(255,210,95,.45); color:#ffe39b; background:rgba(74,43,12,.7); }
#sg-games .sg-lobby-head .sg-btn-primary { border:1px solid #f4c858; background:linear-gradient(#f7d66b,#a66b18); color:#241607; box-shadow:0 2px 8px rgba(0,0,0,.4),inset 0 1px #fff4b2; }
#sg-games .sg-table-grid { grid-template-columns:repeat(auto-fit,minmax(300px,1fr)) !important; gap:14px !important; padding-top:2px !important; }
#sg-games .sg-table-card { border:2px solid #7c4a1b !important; border-radius:10px !important; background:linear-gradient(155deg,#173b2d,#081b15) !important; box-shadow:0 7px 18px rgba(0,0,0,.5),inset 0 1px rgba(255,221,139,.28) !important; }
#sg-games .sg-table-card > header { padding:10px 12px !important; background:linear-gradient(90deg,rgba(91,51,17,.72),rgba(30,59,43,.72)) !important; color:#ffe49a !important; }
#sg-games .sg-table-card > footer { padding:9px 12px !important; background:rgba(0,0,0,.22); }
#sg-games .sg-mini-table { min-height:150px !important; margin:0 10px !important; border:7px solid #85501e !important; background:radial-gradient(ellipse at 50% 45%,#087d50,#045b3b 65%,#023624) !important; box-shadow:inset 0 0 0 2px #d39b38,0 4px 10px rgba(0,0,0,.45) !important; }
#sg-games .sg-mini-center { color:#fff3b3 !important; font-size:14px; text-shadow:0 1px 3px #000; }
#sg-games .sg-mini-seat i { width:30px !important; height:30px !important; background:linear-gradient(#ffe99b,#c78925) !important; box-shadow:0 2px 4px #000; }
#sg-games .sg-mini-seat small { color:#f2ebd8 !important; text-shadow:0 1px 2px #000; }
#sg-games .sg-chip { border:1px solid rgba(255,222,130,.45); border-radius:999px; padding:3px 7px; background:rgba(13,17,12,.62); color:#ffe49a; }
#sg-games .sg-table-card .sg-btn-sm { border-radius:7px; padding:7px 12px; background:linear-gradient(#f5d369,#a56a18); color:#241607; box-shadow:inset 0 1px #fff0a7; }
@media (max-width:720px) {
  #sg-games .sg-lobby-inner { padding:66px 9px 18px !important; }
  #sg-games .sg-lobby-head { gap:8px !important; }
  #sg-games .sg-lobby-head > div { order:0 !important; flex:1 1 auto !important; flex-basis:auto !important; }
  #sg-games .sg-lobby-head .sg-back { order:0 !important; padding:8px 10px; font-size:11px; }
  #sg-games .sg-lobby-head > .sg-btn-primary { order:0 !important; padding:8px 10px; font-size:11px; }
  #sg-games .sg-table-grid { grid-template-columns:1fr !important; gap:11px !important; }
  #sg-games .sg-table-card > footer { font-size:10px; }
}
#sg-games .sg-hud-close{display:grid!important;visibility:visible!important;opacity:1!important}
#sg-games.sg-min{left:10px!important;bottom:10px!important;width:118px!important;height:34px!important;border-radius:8px!important;z-index:2147483005!important}
#sg-games.sg-min .sg-hud{width:118px!important;min-height:34px!important;height:34px!important;padding:3px 7px!important;border-radius:8px!important}
#sg-games.sg-min .sg-hud-left{gap:5px!important;min-width:0!important}
#sg-games.sg-min .sg-hud-left:before{width:22px!important;height:22px!important;border-radius:4px!important;font-size:10px!important}
#sg-games.sg-min .sg-pill{max-width:76px!important;overflow:hidden!important;padding:2px 5px!important;font-size:9px!important}
#sg-games.sg-min .sg-hud-right{display:none!important}
/* Demo chat HUD: compact gold 101 game button */
#sg-games .sg-hud-left::before{content:'101'!important;display:grid!important;place-items:center!important;flex:0 0 48px!important;width:48px!important;height:42px!important;border-radius:8px!important;background:linear-gradient(145deg,#fff0a9 0%,#f1c451 52%,#bd7b16 100%)!important;border:2px solid #8b5b17!important;box-shadow:inset 0 1px 0 #fff8c9,0 2px 7px rgba(0,0,0,.5)!important;color:#63420e!important;font:900 17px/1 Arial,sans-serif!important;letter-spacing:-.05em!important;text-shadow:0 1px 0 rgba(255,255,255,.45)!important;}
#sg-games .sg-chat-panel{border-left:1px solid rgba(255,255,255,.12)!important;box-shadow:-8px 0 24px rgba(0,0,0,.38)!important;}
#sg-games .sg-chat-head{background:#202226!important;border-bottom:1px solid rgba(255,255,255,.12)!important;}
#sg-games .sg-chat-head strong::before{content:'🎲'!important;filter:grayscale(1) brightness(1.45)!important;}
@media(max-width:720px){#sg-games .sg-hud-left::before{flex-basis:42px!important;width:42px!important;height:38px!important;font-size:15px!important;}}
/* Demo: minimized game chip stays at the bottom-right */
#sg-games.sg-min{left:auto!important;right:10px!important;bottom:10px!important}
#sg-games.sg-min .sg-hud-close{display:none!important}
/* Force demo close button to remain visible */
#sg-games .sg-hud .sg-hud-close{display:grid!important;visibility:visible!important;opacity:1!important;width:40px!important;height:40px!important;pointer-events:auto!important}
#sg-games .sg-hud .sg-hud-close[hidden]{display:grid!important}
#sg-games.sg-min .sg-hud .sg-hud-close{display:none!important}
/* Final demo parity: minimized state is only a small game launcher */
#sg-games.sg-min{right:10px!important;left:auto!important;bottom:10px!important;width:58px!important;height:32px!important;min-width:58px!important;max-width:58px!important}
#sg-games.sg-min .sg-hud{width:58px!important;height:32px!important;min-height:32px!important;padding:3px!important;border-radius:7px!important;display:flex!important;justify-content:center!important}
#sg-games.sg-min .sg-hud-left{width:100%!important;justify-content:center!important;gap:0!important}
#sg-games.sg-min .sg-hud-left::before{flex:0 0 34px!important;width:34px!important;height:25px!important;border-radius:5px!important;font-size:12px!important}
#sg-games.sg-min .sg-hud-left .sg-level,#sg-games.sg-min .sg-hud-left .sg-pill{display:none!important}
#sg-games.sg-min .sg-hud-right{display:none!important}
#sg-games:not(.sg-min) .sg-hud-left::before{content:'101'!important;flex:0 0 48px!important;width:48px!important;height:42px!important;border-radius:8px!important;background:linear-gradient(145deg,#fff0a9,#f1c451 52%,#bd7b16)!important;border:2px solid #8b5b17!important;box-shadow:inset 0 1px #fff8c9,0 2px 7px rgba(0,0,0,.5)!important;color:#63420e!important;font:900 17px/1 Arial,sans-serif!important}
/* Demo final pass: gold 101 button, Okey minimized chip, always-visible close */
#sg-games:not(.sg-min) .sg-hud-left::before{content:'101'!important;display:grid!important;place-items:center!important;}
#sg-games:not(.sg-min) .sg-hud-close{display:grid!important;visibility:visible!important;opacity:1!important;position:relative!important;z-index:100!important;}
#sg-games:not(.sg-min) .sg-hud-right{display:flex!important;visibility:visible!important;opacity:1!important;z-index:99!important;}
#sg-games:not(.sg-min) .sg-hud-right::after{content:'×';display:grid;place-items:center;width:40px;height:40px;color:#e7e7e7;font:400 34px/1 Arial,sans-serif;pointer-events:none;position:absolute;right:2px;top:0;}
#sg-games:not(.sg-min) .sg-hud-close{margin-left:0!important;}
#sg-games.sg-min .sg-hud-left::before{content:'O'!important;display:grid!important;place-items:center!important;background:linear-gradient(145deg,#fffef5,#d8eadf)!important;border:2px solid #2a9b71!important;color:#12845b!important;font:900 15px/1 Arial,sans-serif!important;text-shadow:none!important;}
#sg-games.sg-min .sg-hud-left::after{content:'Okey';color:#f7e5a2;font:700 8px/1 Arial,sans-serif;position:absolute;right:4px;bottom:2px;}
#sg-games.sg-min .sg-hud-left{position:relative!important;}
/* Demo reference: Okey/101 game button uses the gold trophy tile */
#sg-games:not(.sg-min) .sg-hud-left::before{content:'🏆'!important;display:grid!important;place-items:center!important;width:48px!important;height:42px!important;flex:0 0 48px!important;border-radius:8px!important;background:linear-gradient(145deg,#fff0a9 0%,#f0c34e 52%,#b87818 100%)!important;border:2px solid #8b5b17!important;box-shadow:inset 0 1px 0 #fff8c9,0 2px 7px rgba(0,0,0,.5)!important;color:#704b08!important;font:normal 23px/1 'Segoe UI Emoji','Apple Color Emoji',sans-serif!important;filter:none!important;text-shadow:none!important;}
@media(max-width:720px){#sg-games:not(.sg-min) .sg-hud-left::before{width:42px!important;height:38px!important;flex-basis:42px!important;font-size:20px!important;}}
/* Demo header controls: dash and close are separate real buttons */
#sg-games:not(.sg-min) .sg-hud-right{position:relative!important;display:flex!important;align-items:center!important;gap:4px!important;}
#sg-games:not(.sg-min) .sg-hud-right::after{display:none!important;content:none!important;}
#sg-games:not(.sg-min) .sg-hud-minimize,#sg-games:not(.sg-min) .sg-hud-close{position:relative!important;inset:auto!important;flex:0 0 40px!important;width:40px!important;height:40px!important;z-index:101!important;}
#sg-games:not(.sg-min) .sg-hud-close svg{display:block!important;width:58%!important;height:58%!important;}
#sg-games:not(.sg-min) .sg-hud-minimize{font-size:28px!important;line-height:1!important;}
/* Demo mobile header: only minimize and close remain on the right */
@media(max-width:720px){
  #sg-games:not(.sg-min) .sg-hud-right > .sg-hud-btn:not(.sg-hud-minimize):not(.sg-hud-close){display:none!important;}
  #sg-games:not(.sg-min) .sg-hud-right{display:flex!important;gap:2px!important;}
  #sg-games:not(.sg-min) .sg-hud-minimize,#sg-games:not(.sg-min) .sg-hud-close{display:grid!important;visibility:visible!important;opacity:1!important;flex:0 0 38px!important;width:38px!important;height:38px!important;}
  #sg-games:not(.sg-min) .sg-hud-close svg{display:none!important;}
  #sg-games:not(.sg-min) .sg-hud-close::before{content:'×';display:grid;place-items:center;color:#ececec;font:400 31px/1 Arial,sans-serif;}
}
/* Demo chat header: real, clickable gold trophy game button */
#sg-games .sg-hud-game{display:grid!important;place-items:center!important;flex:0 0 48px!important;width:48px!important;height:42px!important;padding:0!important;border-radius:8px!important;border:2px solid #8b5b17!important;background:linear-gradient(145deg,#fff0a9 0%,#f0c34e 52%,#b87818 100%)!important;box-shadow:inset 0 1px #fff8c9,0 2px 7px rgba(0,0,0,.5)!important;cursor:pointer!important;}
#sg-games .sg-hud-game span{font:normal 23px/1 'Segoe UI Emoji','Apple Color Emoji',sans-serif!important;filter:none!important;}
#sg-games .sg-hud-left::before{display:none!important;content:none!important;}
@media(max-width:720px){#sg-games:not(.sg-min) .sg-hud-game{flex-basis:42px!important;width:42px!important;height:38px!important}#sg-games .sg-hud-game span{font-size:20px!important}}
#sg-games.sg-min .sg-hud-game{flex-basis:34px!important;width:34px!important;height:25px!important;border-radius:5px!important}
#sg-games.sg-min .sg-hud-game span{font-size:14px!important}
/* Force the demo trophy icon above every HUD layer */
#sg-games .sg-hud-game{position:relative!important;z-index:200!important;display:grid!important;visibility:visible!important;opacity:1!important;overflow:visible!important;}
#sg-games .sg-hud-game span{display:block!important;visibility:visible!important;opacity:1!important;position:relative!important;z-index:201!important;color:#704b08!important;}
#sg-games .sg-hud-left{overflow:visible!important;}
#sg-games .sg-hud-left .sg-hud-game + .sg-level{display:none!important;}
#sg-games .sg-hud-left .sg-hud-game + .sg-level + .sg-pill{display:flex!important;}
/* Demo Oyunlar control: trophy button plus title */
#sg-games .sg-hud-games-label{display:inline-block!important;color:#f6f1e2!important;font-size:clamp(16px,2vw,23px)!important;font-weight:800!important;white-space:nowrap!important;text-shadow:0 2px 5px #000!important;}
#sg-games.sg-min .sg-hud-games-label{display:none!important;}
@media(max-width:720px){#sg-games .sg-hud-games-label{font-size:16px!important;}}
/* Demo chat panel game button */
#sg-games .sg-chat-head{display:flex!important;align-items:center!important;gap:8px!important;}
#sg-games .sg-chat-head strong{flex:1 1 auto!important;min-width:0!important;}
#sg-games .sg-chat-game{display:grid!important;place-items:center!important;flex:0 0 42px!important;width:42px!important;height:34px!important;padding:0!important;border-radius:7px!important;border:2px solid #8b5b17!important;background:linear-gradient(145deg,#fff0a9,#f0c34e 52%,#b87818)!important;box-shadow:inset 0 1px #fff8c9,0 2px 6px rgba(0,0,0,.5)!important;cursor:pointer!important;}
#sg-games .sg-chat-game span{font:normal 19px/1 'Segoe UI Emoji','Apple Color Emoji',sans-serif!important;}
#sg-games .sg-chat-game:hover{filter:brightness(1.08)!important;}


/* ========================================================================
   DEMO GİBİ: ORTADAKİ TAŞIN ÜSTÜNE BIRAK → TAŞ AT / EL BİTİR
   Halka, games.js içindeki middleDropTarget()/iskarta kutusu kabulü ile aynı
   dikdörtgendir. Çuhasının boş yeri hedef değildir; masanın tamamı halka
   olmaz, yalnızca bırakılabilecek taşın üstü yanar.
   ===================================================================== */
#sg-games .sg-piles::after { display: none !important; }
#sg-games .sg-piles::before { display: none !important; }
#sg-games .sg-discard-target {
  position: absolute;
  box-sizing: border-box;
  display: flex; align-items: flex-end; justify-content: center;
  border: 2px dashed rgba(255, 226, 138, .9);
  border-radius: 14px;
  background: radial-gradient(ellipse at center, rgba(255, 214, 90, .18), rgba(0, 58, 40, .06) 64%, transparent 78%);
  box-shadow: inset 0 0 20px rgba(255, 214, 90, .18), 0 0 0 1px rgba(0, 0, 0, .35);
  pointer-events: none;
  z-index: 9;
  transition: border-color .1s ease, background .1s ease, box-shadow .1s ease;
}
#sg-games .sg-discard-target[hidden] { display: none !important; }
#sg-games .sg-discard-target::after {
  content: "BIRAK · TAŞ AT";
  position: absolute; top: calc(100% + .35em); left: 50%;
  transform: translateX(-50%);
  font-size: clamp(8px, 1vw, 11px);
  font-weight: 900; letter-spacing: .2em;
  color: #ffe28a;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .9);
  white-space: nowrap;
}
#sg-games .sg-discard-target.sg-finish-target {
  border-style: solid;
  border-color: #9ff5c8;
  background: radial-gradient(ellipse at center, rgba(90, 226, 150, .24), rgba(0, 60, 40, .08) 64%, transparent 78%);
  box-shadow: inset 0 0 22px rgba(120, 240, 180, .24), 0 0 0 1px rgba(0, 0, 0, .35);
}
#sg-games .sg-discard-target.sg-finish-target::after {
  content: "EL BİTİR · BURAYA BIRAK";
  color: #bbffe0;
}
#sg-games .sg-stock.sg-discard-zone,
#sg-games .sg-indicator.sg-discard-zone,
#sg-games .sg-piles .sg-discard-zone {
  filter: drop-shadow(0 0 9px rgba(255, 214, 90, .6));
}
#sg-games .sg-drag-active .sg-discard-drop {
  border-color: #ffe28a !important;
  box-shadow: 0 0 0 2px rgba(255, 215, 106, .55), 0 8px 18px rgba(0, 0, 0, .5) !important;
}
#sg-games .sg-my-turn.sg-drag-active .sg-discard-target { opacity: 1; }
/* Chat button is available only inside an active game table */
#sg-games .sg-hud-chat{display:none!important;}
#sg-games.sg-has-table:not(.sg-min) .sg-hud-chat{display:grid!important;}
#sg-games.sg-min .sg-hud-chat{display:none!important;}

/* Live score: show the actual table total during the hand, not only after round end */
#sg-games .sg-plate-text .sg-total-score{position:static!important;display:inline-flex!important;transform:none!important;margin-top:2px!important;bottom:auto!important;left:auto!important;}
#sg-games .sg-plate-text .sg-total-score i{display:inline-block!important;}
