@font-face {
  font-family: 'ShashkaLocal';
  src: url('../fonts/shashka-local-900.woff2') format('woff2');
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}



:root {
  --ink:        #0A1523;
  --ink-2:      #102034;
  --ink-3:      #1A3050;
  --line:       rgba(226, 169, 59, 0.20);
  --brass:      #E2A93B;
  --brass-hi:   #FFDD8A;
  --brass-deep: #9C6C18;
  --turq:       #2FBFA8;
  --pome:       #D8564B;
  --cream:      #F3E7D0;
  --muted:      #8DA2BE;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

html, body {
  /* force-dark dan himoya - meta color-scheme bilan juft ishlaydi */
  color-scheme: dark;
  margin: 0; padding: 0;
  width: 100%;
  /* ZAXIRA: JS hali --app-height ni qo'ymagan bo'lsa (yoki umuman
     ishlamasa) eski brauzerlar uchun 100vh kerak. `dvh` faqat Chrome 108+
     da bor - undan eski WebView bu qatorni YAROQSIZ deb tashlab yuboradi
     va height: auto bo'lib qolardi -> butun ilova yigilib, QORA EKRAN. */
  height: var(--app-height, 100vh);
  height: var(--app-height, 100dvh);
  min-height: 0;
  position: fixed;
  left: 0; top: 0; right: 0; bottom: 0;
  overflow: hidden;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font);
  overscroll-behavior: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#app, .screen, .btn, button, canvas, .board-wrap, .gold-btn, .outline-btn {
  touch-action: manipulation;
  -webkit-touch-callout: none;
}

canvas {

  image-rendering: auto;
}

#bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: #372012 url('../design/orqafon.png') center center / 100% 100% no-repeat;
}

#scr-menu { padding: 0; overflow: hidden; }

.menu-bg-wrap {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 10px 16px;
  overflow: hidden;
  -webkit-overflow-scrolling: auto;
  overscroll-behavior: none;

  background: transparent;
}.menu-center {
  display: flex; flex-direction: column;
  align-items: center; gap: 0;
  max-width: 620px; width: 100%;
}

.menu-main-btns {
  width: min(80%, 430px); display: flex; flex-direction: column;
  gap: 12px; margin-top: -8px;
}

.gold-btn {
  display: flex !important; align-items: center; justify-content: flex-start !important; gap: 0 !important;
  width: 100%;
  min-height: 0;
  aspect-ratio: 4.32 / 1;
  padding: 0 45px 2.4% 32px !important;
  border: 0 !important;
  border-radius: 0 !important;
  font-size: 18px !important; font-weight: 900; letter-spacing: .04em;
  text-transform: uppercase;
  color: #3D2808 !important;
  /* BUG FIX ("orqadan ortiqcha karta chiqib qolishi"): bu yerda ORQA FON RANGI
     '#F9D195' turardi. 'tepakarta.png' ning chekkalari SHAFFOF (yumaloq
     burchaklar + soya), shuning uchun rang rasm ostidan chiqib, tugma
     ortida yana bitta TO'RTBURCHAK karta bo'lib ko'rinardi. Menyu to'liq
     ekranda kattalashgach bu yanada yaqqol sezildi.
     Endi faqat rasmning o'zi ko'rinadi. */
  background: transparent url('../design/tepakarta.png') center center / 100% 100% no-repeat !important;
  box-shadow: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease !important;
  position: relative;
  overflow: visible;
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}
.gold-btn::before {
  display: none;
}
.gold-btn::after {
  content: "\203A";
  position: absolute; right: 20px; top: 45%; transform: translateY(-52%);
  color: #F6E6B8;
  font-size: 30px; font-weight: 700; line-height: 1; z-index: 2;
}
.gold-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: none;
}
#scr-menu .gold-btn:active { transform: translateY(0) scale(.99); }
.gold-btn.menu-tone-1,
.gold-btn.menu-tone-2,
.gold-btn.menu-tone-3 {
  background: transparent url('../design/tepakarta.png') center center / 100% 100% no-repeat !important;
  color: #3D2808 !important;
  box-shadow: none;
}
.gold-btn.menu-tone-1::after { color: #F6E6B8; }

.gold-btn > span:not(.gold-icon) {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  flex: 0 1 auto;
  min-width: 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: .03em;
  position: relative; z-index: 1;
}

.gold-icon {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 68px; height: 68px; flex: 0 0 68px;
  margin-right: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #241A10, #1C130C 70%);
  border: 2px solid #D9B45C;
  color: #D9B45C;
  box-shadow: inset 0 2px 5px rgba(255,255,255,0.08);
  z-index: 1;
}
.gold-icon svg { width: 34px; height: 34px; }

.menu-rule {
  width: min(88%, 560px);
  max-width: none;
  margin: 15px auto 13px;
  gap: 14px;
}
#scr-menu .menu-rule::before,
#scr-menu .menu-rule::after {
  height: 1px;
  background: linear-gradient(90deg, transparent, #8D5C1B 12%, #F4D27B 72%, #8D5C1B);
  box-shadow: 0 1px 0 rgba(25, 11, 2, .85);
}
#scr-menu .menu-rule::after {
  transform: scaleX(-1);
}
#scr-menu .menu-rule i {
  width: 10px;
  height: 10px;
  background: linear-gradient(135deg, #FFE69B, #B9781E 58%, #6D4110);
  border: 1px solid #F5D175;
  opacity: 1;
  box-shadow: 0 0 5px rgba(255, 205, 91, .55);
}

.menu-bottom-btns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: 90%;
  margin: 0 auto;
  box-sizing: border-box;
}

.outline-btn {
  display: flex !important; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-width: 0;
  min-height: 0;
  aspect-ratio: 1.05 / 1;
  padding: 16px 12px;
  border: 0 !important;
  border-radius: 0 !important;
  background: #251508 url('../design/pastkikarta.png') center center / 134% auto no-repeat !important;
  box-shadow: none !important;
  color: #FFF2D4 !important;
  font-weight: 800;
  font-size: clamp(12px, 1.35vw, 14px);
  text-transform: uppercase !important;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
  cursor: pointer;
  transition: all 0.2s ease !important;
  box-sizing: border-box;
  text-align: center;
}

.outline-btn:hover, .outline-btn:active {
  background: #251508 url('../design/pastkikarta.png') center center / 134% auto no-repeat !important;
  box-shadow: none !important;
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.outline-btn + .outline-btn { margin-top: 0 !important; }

.outline-btn span:not(.outline-icon) {
  white-space: normal;
  line-height: 1.15;
  font-size: clamp(12px, 1.35vw, 14px);
  font-weight: 800;
  text-transform: uppercase !important;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
  width: 100%; min-width: 0;
  text-align: center;
}

#m-settings span:not(.outline-icon) {
  letter-spacing: 0.1px;
  font-size: clamp(11.5px, 1.3vw, 13.5px);
}

.outline-icon {
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; flex: 0 0 52px;
  background-position: center;
  background-size: 273% auto;
  background-repeat: no-repeat;
}
.outline-icon svg { display: none; }
#m-rules .outline-icon { background-image: url('../design/book.png'); }
#m-leaders .outline-icon { background-image: url('../design/lider.png'); transform: translateY(3px); }
#m-profile .outline-icon { background-image: url('../design/person.png'); }
#m-settings .outline-icon { background-image: url('../design/settings.png'); }
#m-rules .outline-icon,
#m-profile .outline-icon { background-size: 330% auto; }

.outline-icon,
#m-rules .outline-icon, #m-leaders .outline-icon,
#m-profile .outline-icon, #m-settings .outline-icon {
  background-image: none !important;
  transform: none !important;
  color: #FFD978;
  filter: none;
}
.outline-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 1.8;
  filter: none;
}

@media (max-width: 520px) {
  .menu-bg-wrap {
    padding: max(4px, env(safe-area-inset-top, 0px)) 8px max(4px, env(safe-area-inset-bottom, 0px));
    overflow: hidden;
    justify-content: center;
  }
  .menu-bg-wrap .menu-center {
    transform: scale(var(--menu-scale, var(--mobile-menu-scale, .82)));
    transform-origin: center center;
    flex: 0 0 auto;
    will-change: transform;
  }
  .menu-main-btns { width: min(92%, 390px); gap: 10px; }
  .gold-btn {
    min-height: 0;
    aspect-ratio: 4.32 / 1;
    padding: 0 38px 2.4% 26px !important;
    border-radius: 0 !important;
  }
  .gold-btn > span:not(.gold-icon) {
    font-size: clamp(16px, 4.6vw, 20px) !important;
    letter-spacing: 0.02em !important;
    text-align: left !important;
    justify-content: flex-start !important;
  }
  .gold-btn::after { right: 16px; font-size: 28px; }
  .gold-icon { width: 60px; height: 60px; flex: 0 0 60px; margin-right: 14px; }
  .gold-icon svg { width: 30px; height: 30px; }
  .menu-bottom-btns { grid-template-columns: repeat(4, 1fr); gap: 3px; width: 90%; }
  .outline-btn {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 32px auto;
    place-items: center;
    min-height: 0;
    padding: 6px 4px;
    gap: 4px !important;
  }
  .outline-btn > .outline-icon { grid-row: 1; }
  .outline-btn > span:not(.outline-icon) {
    grid-row: 2;
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: clamp(9px, 2.5vw, 11px) !important;
    font-weight: 800 !important;
    letter-spacing: 0.1px !important;
    line-height: 1.05;
  }
  #m-settings span:not(.outline-icon) {
    font-size: clamp(8px, 2.1vw, 9.5px) !important;
    letter-spacing: 0.1px !important;
  }
  .outline-icon { width: 32px; height: 32px; flex: 0 0 32px; }
}

@media (min-width: 521px) {
  html:not(.compact-window) #scr-menu.active .menu-bg-wrap {
    justify-content: center;
    padding: 0 16px;
    overflow: hidden;
  }
  html:not(.compact-window) #scr-menu.active .menu-center {
    transform: scale(var(--menu-scale, var(--desktop-menu-scale, .82)));
    transform-origin: center center;
    flex: 0 0 auto;
  }
}

#app {
  position: relative; z-index: 1;
  width: 100%;
  height: var(--app-height, 100%);
  min-height: 0;
  max-height: var(--app-height, 100%);
  display: flex; flex-direction: column;
  padding: var(--safe-t) 0 var(--safe-b);
}

.screen {
  position: absolute; inset: 0;
  height: var(--app-height, 100%);
  min-height: 0;
  display: none;
  flex-direction: column;
  padding: 14px 16px;
  opacity: 0;
  transition: opacity .22s ease;
}
.screen.active { display: flex; opacity: 1; }
.screen.inner { overflow-y: auto; -webkit-overflow-scrolling: touch; }
#scr-menu { overflow: hidden !important; overscroll-behavior: none; touch-action: pan-x pan-y; }
#scr-menu .menu-bg-wrap { overflow: hidden !important; min-height: 100%; box-sizing: border-box; }

.wrap { width: 100%; max-width: 560px; margin: 0 auto; }

.plaque {
  text-align: center;
  padding: 10px 10px 12px;
  width: 100%;
  /* Menyudagi .plaque endi <h1> - brauzerning standart chekinishi va
     shrift o'lchami menyuni surib yubormasligi uchun nolga tenglanadi. */
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}
.title-svg {
  width: 100%;
  max-width: 560px;
  height: auto;
  display: block;
  margin: 0 auto;
  overflow: visible;
}
.title-svg text {
  font-family: 'ShashkaLocal', var(--font), sans-serif;
  font-weight: 900;
  font-size: 98px;
  letter-spacing: 5px;
  text-transform: uppercase;
}
.plaque p {
  margin: 4px 0 0;
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--muted);
}

.piece {
  position: absolute;
  transition: transform 0.35s cubic-bezier(.45,0,.2,1);
  will-change: transform;
}

.rule {
  display: flex; align-items: center; gap: 10px;
  margin: 14px auto 18px; max-width: 320px;
}
.rule::before, .rule::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}
.rule i {
  width: 9px; height: 9px; transform: rotate(45deg);
  background: var(--brass); opacity: .8;
  box-shadow: 14px 0 0 -2px var(--brass), -14px 0 0 -2px var(--brass);
}

.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  padding: 15px 18px;
  border: 0; border-radius: var(--r-md);
  font-family: var(--font);
  font-size: 16px; font-weight: 700; letter-spacing: .03em;
  color: var(--cream);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.10);
  cursor: pointer;
  transition: transform .12s ease, background .18s ease, border-color .18s ease;
}
.btn:active { transform: translateY(2px) scale(.99); }
.btn:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
.btn + .btn { margin-top: 10px; }
.gold-btn + .gold-btn { margin-top: 0; }
.outline-btn + .outline-btn { margin-top: 0; }

.menu-bottom-btns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 11px;
  width: min(80%, 430px);
}

.outline-btn,
#m-rules, #m-leaders, #m-profile, #m-settings {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  justify-content: flex-start;
  width: 100% !important;
  height: 74px !important;
  min-height: 74px !important;
  aspect-ratio: auto !important;
  padding: 9px 11px !important;
  transform: none !important;
  border: 2px solid rgba(205, 154, 49, .78) !important;
  border-radius: 16px !important;
  background: linear-gradient(145deg, #172237 0%, #0b1423 100%) !important;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 225, 147, .16), 0 3px 8px rgba(0, 0, 0, .42) !important;
}

.outline-btn:hover, .outline-btn:active {
  background: linear-gradient(145deg, #20304a 0%, #101b2c 100%) !important;
  transform: translateY(-2px) !important;
}

.outline-icon,
#m-rules .outline-icon, #m-leaders .outline-icon,
#m-profile .outline-icon, #m-settings .outline-icon {
  width: 36px !important;
  height: 36px !important;
  flex: 0 0 36px !important;
  margin: 0 8px 0 1px;
  transform: none !important;
  background-size: 280% auto !important;
}

#m-rules .outline-icon, #m-profile .outline-icon { background-size: 340% auto !important; }

.outline-btn > span:not(.outline-icon),
#m-rules > span:not(.outline-icon), #m-leaders > span:not(.outline-icon),
#m-profile > span:not(.outline-icon), #m-settings > span:not(.outline-icon) {
  width: auto !important;
  height: auto !important;
  transform: none !important;
  text-align: left;
  font-size: clamp(11px, 1.45vw, 14.5px) !important;
  line-height: 1.12;
  letter-spacing: .02em !important;
}

@media (max-width: 520px) {
  .menu-bottom-btns { gap: 10px 12px; width: min(92%, 390px); }
  .outline-btn,
  #m-rules, #m-leaders, #m-profile, #m-settings {
    height: 72px !important;
    min-height: 72px !important;
    padding: 8px 9px !important;
    border-radius: 14px !important;
  }
  .outline-icon,
  #m-rules .outline-icon, #m-leaders .outline-icon,
  #m-profile .outline-icon, #m-settings .outline-icon {
    width: 42px !important;
    height: 42px !important;
    flex: 0 0 42px !important;
    margin-right: 8px;
  }
  .outline-btn > span:not(.outline-icon),
  #m-rules > span:not(.outline-icon), #m-leaders > span:not(.outline-icon),
  #m-profile > span:not(.outline-icon), #m-settings > span:not(.outline-icon) {
    font-size: clamp(11px, 3vw, 13.5px) !important;
    line-height: 1.08;
  }
}

@media (min-width: 521px) {
  .menu-main-btns {
    width: min(88%, 560px);
    max-width: 560px;
  }

  .gold-icon {
    width: 68px;
    height: 68px;
    flex-basis: 68px;
    margin-right: 20px;
  }
  .gold-icon svg { width: 34px; height: 34px; }
  .gold-btn > span:not(.gold-icon) { font-size: 21px !important; }

  .menu-bottom-btns {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
    width: min(88%, 560px);
  }

  .outline-btn,
  #m-rules, #m-leaders, #m-profile, #m-settings {
    flex-direction: column !important;
    justify-content: center;
    height: 78px !important;
    min-height: 78px !important;
    padding: 7px 5px !important;
    gap: 3px !important;
  }

  .outline-icon,
  #m-rules .outline-icon, #m-leaders .outline-icon,
  #m-profile .outline-icon, #m-settings .outline-icon {
    width: 38px !important;
    height: 38px !important;
    flex: 0 0 38px !important;
    margin: 0;
  }

  #m-profile .outline-icon {
    background-size: 320% auto !important;
    background-position: center 43%;
  }

  #m-settings .outline-icon {
    background-size: 235% auto !important;
    background-position: center;
  }

  .outline-btn > span:not(.outline-icon),
  #m-rules > span:not(.outline-icon), #m-leaders > span:not(.outline-icon),
  #m-profile > span:not(.outline-icon), #m-settings > span:not(.outline-icon) {
    text-align: center;
    font-size: clamp(9px, .86vw, 11.5px) !important;
    line-height: 1.05;
  }
}

#scr-menu .outline-btn {
  transition: transform .16s ease, filter .16s ease, background .16s ease !important;
}
#scr-menu .outline-btn:active {
  transform: scale(1.025) !important;
  filter: brightness(1.1);
}
@media (min-width: 521px) and (hover: hover) {
  #scr-menu .outline-btn:hover {
    transform: translateY(-2px) scale(1.015) !important;
    filter: brightness(1.1);
  }
}
.online-lobby-card .btn + .btn { margin-top: 0; }

.btn.primary {
  background: linear-gradient(180deg, var(--brass-hi), var(--brass) 45%, var(--brass-deep));
  color: #231804;
  border-color: rgba(255,221,138,.55);
  box-shadow: 0 6px 18px rgba(226,169,59,.20), inset 0 1px 0 rgba(255,255,255,.45);
}
.btn.ghost { background: transparent; }
.btn.small { padding: 11px 14px; font-size: 14px; }
.btn[disabled] { opacity: .42; pointer-events: none; }

.btn-row { display: flex; gap: 10px; }
.btn-row .btn { margin-top: 0; }

.seg { display: flex; gap: 8px; }
.seg button {
  flex: 1; padding: 12px 6px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  color: var(--muted);
  font: 600 14px var(--font);
  cursor: pointer;
  transition: all .16s ease;
}
.seg button.on {
  background: linear-gradient(180deg, rgba(226,169,59,.22), rgba(226,169,59,.08));
  border-color: var(--brass);
  color: var(--brass-hi);
}
.seg button:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

.field { margin: 0 0 16px; }
.field > label {
  display: block; margin: 0 0 8px;
  font-size: 12px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}

#scr-settings .wrap { max-width: 560px; }
#scr-settings .screen-head h2 {
  color: #FFD978;
  text-shadow: 0 2px 2px rgba(0, 0, 0, .8);
}
#scr-settings .icon-btn {
  color: #FFF1CB;
  border-color: rgba(231, 183, 73, .52);
  background: rgba(9, 17, 27, .62);
}
#scr-settings .field > label {
  color: #F3C45E;
  font-size: 13px;
  text-shadow: 0 2px 2px rgba(0, 0, 0, .9);
}
#scr-settings .seg { gap: 10px; }
#scr-settings .seg button {
  min-height: 50px;
  border-color: rgba(226, 169, 59, .5);
  background: linear-gradient(135deg, rgba(8, 17, 29, .76), rgba(22, 31, 43, .62));
  color: #F7E8C8;
  font-weight: 800;
  letter-spacing: .02em;
  text-shadow: 0 2px 2px rgba(0, 0, 0, .9);
  box-shadow: inset 0 1px 0 rgba(255, 232, 168, .1), 0 2px 5px rgba(0, 0, 0, .3);
}
#scr-settings .seg button.on {
  background: linear-gradient(180deg, #F6D989, #C98D29 54%, #986218);
  border-color: #FFE5A0;
  color: #221503;
  text-shadow: 0 1px 0 rgba(255, 248, 208, .5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 230, .65), 0 3px 8px rgba(0, 0, 0, .45);
}
#scr-settings .seg button:hover { filter: brightness(1.08); }

/* TIL TANLASH - yagona qatorga sig'maydi.
   `.seg` flex bo'lgani uchun tugmalar bir qatorga tiqilardi va sakkiz
   til qo'shilganda nomlar ("Português", "Русский") ustma-ust tushib
   o'qilmay qolardi. Setka esa joyga qarab o'zi qatorlarga bo'ladi:
   tor telefonda 2-3 ta, keng ekranda 4-5 ta ustun. */
#sel-lang {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
}

#scr-rules .list li {
  margin-bottom: 8px;
  padding: 11px 14px;
  border: 1px solid rgba(226, 169, 59, .25);
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(8, 15, 24, .58), rgba(8, 15, 24, .16));
  color: #FFF0D2;
  font-weight: 600;
  text-shadow: 0 2px 2px rgba(0, 0, 0, .9);
}
#scr-rules .list li em {
  background: #F3C45E;
  opacity: 1;
  box-shadow: 0 0 4px rgba(255, 205, 91, .35);
}

#scr-setup .field > label,
#scr-online-setup .field > label {
  color: #F3C45E;
  font-size: 13px;
  text-shadow: 0 2px 2px rgba(0, 0, 0, .9);
}
#scr-setup .seg button,
#scr-online-setup .seg button {
  min-height: 50px;
  border-color: rgba(226, 169, 59, .5);
  background: linear-gradient(135deg, rgba(8, 17, 29, .76), rgba(22, 31, 43, .62));
  color: #F7E8C8;
  font-weight: 800;
  text-shadow: 0 2px 2px rgba(0, 0, 0, .9);
  box-shadow: inset 0 1px 0 rgba(255, 232, 168, .1), 0 2px 5px rgba(0, 0, 0, .3);
}
#scr-setup .seg button.on,
#scr-online-setup .seg button.on {
  background: linear-gradient(180deg, #F6D989, #C98D29 54%, #986218);
  border-color: #FFE5A0;
  color: #221503;
  text-shadow: 0 1px 0 rgba(255, 248, 208, .5);
}

#scr-game .topbar .icon-btn {
  width: 44px; height: 44px; flex: 0 0 44px;
  border-radius: 12px;
  border-color: rgba(226, 169, 59, .55);
  background: linear-gradient(135deg, rgba(8, 17, 29, .88), rgba(22, 31, 43, .78));
  color: #FFF0D2;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 232, 168, 0.15);
  text-shadow: 0 2px 2px rgba(0, 0, 0, .9);
}
#scr-game .topbar .icon-btn svg {
  width: 22px; height: 22px; stroke-width: 2.3;
}
#scr-game .act {
  border-color: rgba(226, 169, 59, .42);
  background: linear-gradient(135deg, rgba(8, 17, 29, .82), rgba(22, 31, 43, .68));
  color: #FFF0D2;
  text-shadow: 0 2px 2px rgba(0, 0, 0, .9);
}
#scr-game .strip {
  border-color: rgba(226, 169, 59, .34);
  background: linear-gradient(135deg, rgba(8, 17, 29, .8), rgba(22, 31, 43, .65));
  box-shadow: inset 0 1px 0 rgba(255, 232, 168, .08), 0 2px 7px rgba(0, 0, 0, .35);
}
#scr-game .strip .who { color: #FFF0D2; text-shadow: 0 2px 2px rgba(0, 0, 0, .9); }
#scr-game .strip .who small,
#scr-game .turn-chip u { color: #F3C45E; }
#scr-game .turn-chip { color: #FFF0D2; font-weight: 800; text-shadow: 0 2px 2px rgba(0, 0, 0, .9); }

#scr-loading { align-items: center; justify-content: center; }
#load-status {
  font-size: 22px;
  font-weight: 800;
  color: #FFD56A;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
  margin-top: 10px;
  text-align: center;
}
.load-flags { display:flex; justify-content:center; gap:10px; margin-bottom:20px; }
.load-flags img { width:32px; height:22px; border-radius:4px; box-shadow:0 0 10px rgba(0,0,0,0.5); border:1px solid rgba(255,255,255,0.25); animation: flag-pulse 1.5s infinite ease-in-out; }
.load-flags img:nth-child(2) { animation-delay: 0.2s; }
.load-flags img:nth-child(3) { animation-delay: 0.4s; }
.load-flags img:nth-child(4) { animation-delay: 0.6s; }
.load-flags img:nth-child(5) { animation-delay: 0.8s; }
.load-flags img:nth-child(6) { animation-delay: 1.0s; }
@keyframes flag-pulse { 0%, 100% { transform: scale(1); opacity: 0.6; } 50% { transform: scale(1.2); opacity: 1; } }

.load-progress {
  width: min(320px, 82vw);
  margin-top: 24px;
  text-align: center;
}
.load-progress__track {
  height: 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 1.5px solid rgba(226, 169, 59, 0.35);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.5);
}
.load-progress__track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brass-deep), var(--brass-hi), #fff1ad);
  box-shadow: 0 0 14px rgba(255,218,118,.8);
  transition: width .16s ease-out;
}
.load-progress strong {
  display: block;
  margin-top: 12px;
  font-size: 20px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: .08em;
  color: #FFF2D4;
  text-shadow: 0 2px 4px rgba(0,0,0,.8);
}

#scr-game { padding: 8px 10px; gap: 8px; }

.topbar {
  display: flex; align-items: center; gap: 8px;
  min-height: 40px; margin: 0 auto; width: 100%; box-sizing: border-box;
}
.icon-btn {
  width: 38px; height: 38px; flex: 0 0 38px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: var(--cream);
  cursor: pointer;
  transition: background .16s ease, transform .12s ease;
}
.icon-btn:active { transform: scale(.93); }
.icon-btn:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.turn-chip {
  flex: 1; text-align: center;
  font-size: 13px; font-weight: 700; letter-spacing: .08em;
  color: var(--muted);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 0;
}
.turn-chip .dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--cream);
  box-shadow: 0 0 0 1px rgba(0,0,0,.4) inset;
  flex: 0 0 auto;
}
.turn-chip .dot.black { background: #23252D; }
.turn-chip.active { color: var(--brass-hi); }
.turn-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.turn-chip u {
  text-decoration: none; font-size: 12px; font-weight: 700;
  color: var(--muted); font-variant-numeric: tabular-nums;
  padding-left: 8px; border-left: 1px solid rgba(255,255,255,.10);
}

.strip {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px;
  border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015));
  border: 1px solid rgba(255,255,255,.07);
  min-height: 58px;
}
.strip.turn { border-color: var(--line); box-shadow: 0 0 0 1px rgba(226,169,59,.12), 0 0 22px -8px rgba(226,169,59,.5); }

#scr-game .strip.turn {
  border-color: #F3C45E;
  background: linear-gradient(135deg, rgba(243,196,94,.20), rgba(22,31,43,.65));
  animation: stripTurnPulse 1.6s ease-in-out infinite;
}
#scr-game .strip.turn .seat { box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 0 0 2px #F3C45E, 0 0 10px 1px rgba(243,196,94,.7); }
@keyframes stripTurnPulse {
  0%, 100% { box-shadow: 0 0 0 1.5px rgba(243,196,94,.45), 0 0 16px -3px rgba(243,196,94,.55), inset 0 1px 0 rgba(255,232,168,.1); }
  50% { box-shadow: 0 0 0 1.5px rgba(243,196,94,.9), 0 0 30px 0px rgba(243,196,94,.85), inset 0 1px 0 rgba(255,232,168,.18); }
}
.strip .who { font-size: 13px; font-weight: 700; white-space: nowrap; min-width: 0; overflow: hidden; }
.strip .who span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip .who small { display: block; font-size: 10.5px; font-weight: 600; color: var(--muted); letter-spacing: .08em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 2px 6px rgba(0,0,0,.5);
}
.seat.w, .chip.w {
  background: url('../img/white.png') center/cover no-repeat !important;
  border: 1px solid rgba(255,255,255,0.4);
}
.seat.b, .chip.b {
  background: url('../img/black.png') center/cover no-repeat !important;
  border: 1px solid rgba(255,255,255,0.2);
}

body[data-piece-style="style2"] .seat.w,
body[data-piece-style="style2"] .chip.w {
  background: url('../img/white.png') center/cover no-repeat !important;
  border: 1px solid rgba(255,255,255,0.4);
}
body[data-piece-style="style2"] .seat.b,
body[data-piece-style="style2"] .chip.b {
  background: url('../img/black.png') center/cover no-repeat !important;
  border: 1px solid rgba(255,255,255,0.2);
}

body[data-piece-style="style3"] .seat.w,
body[data-piece-style="style3"] .chip.w {
  background: url('../img/white2.png') center/cover no-repeat !important;
  border: 1px solid rgba(255,255,255,0.4);
}
body[data-piece-style="style3"] .seat.b,
body[data-piece-style="style3"] .chip.b {
  background: url('../img/black2.png') center/cover no-repeat !important;
  border: 1px solid rgba(255,255,255,0.2);
}
.taken {
  flex: 0 0 auto; min-width: 26px; text-align: center;
  font-size: 14px; font-weight: 800; color: var(--brass);
  font-variant-numeric: tabular-nums;
}
.tray { display: flex; flex-wrap: wrap; gap: 3px; flex: 1; justify-content: flex-end; align-content: center; }
.chip {
  width: 16px; height: 16px; border-radius: 50%;
  animation: pop .32s cubic-bezier(.2,1.5,.5,1) both;
}
.chip.k { box-shadow: 0 0 0 1.5px var(--brass); }
@keyframes pop { from { transform: scale(0) rotate(-40deg); opacity: 0 } to { transform: none; opacity: 1 } }

.move-timer {
  display: none;
  position: relative;
  width: 34px; height: 34px;
  flex: 0 0 34px;
  align-items: center; justify-content: center;
  margin-left: auto;
}
.move-timer-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.move-timer .mt-bg { fill: none; stroke: rgba(255,255,255,.14); stroke-width: 2.6; }
.move-timer .mt-fg {
  fill: none; stroke: var(--brass); stroke-width: 2.6; stroke-linecap: round;
  stroke-dasharray: 97.39;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke .25s ease;
}
.move-timer-num {
  position: relative; z-index: 1;
  font-size: 12px; font-weight: 800;
  color: #FFF0D2;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0,0,0,.8);
  transition: color .25s ease;
}
.move-timer.idle { opacity: .5; }
.move-timer.idle .mt-fg { stroke: rgba(255,255,255,.22); }
.move-timer.warn .mt-fg { stroke: #FF5C4D; }
.move-timer.warn .move-timer-num {
  color: #FF7A68;
  animation: mtWarnPulse .9s ease-in-out infinite;
}
@keyframes mtWarnPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

.flying-chip {
  position: fixed;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  z-index: 9999;
  pointer-events: none;
  box-shadow: 0 8px 22px rgba(0,0,0,0.7), 0 0 14px rgba(226,169,59,0.55);
  transition: left 0.75s cubic-bezier(0.2, 0.9, 0.2, 1), top 0.75s cubic-bezier(0.2, 0.9, 0.2, 1), transform 0.75s ease, opacity 0.75s ease;
  transform-origin: center center;
}
.flying-chip.w {
  background: radial-gradient(circle at 34% 30%, #FBF3E2, #D8C39C 62%, #A98B5C);
  border: 1px solid rgba(255, 255, 255, 0.8);
}
.flying-chip.b {
  background: radial-gradient(circle at 34% 30%, #4A4E5C, #1E2028 62%, #0B0C0F);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.flying-chip.k {
  box-shadow: 0 0 0 2px var(--brass), 0 8px 20px rgba(0,0,0,0.7);
}

.taken { transition: transform 0.2s ease, color 0.2s ease; }
.taken.pulse {
  animation: takenPulse 0.45s cubic-bezier(0.17, 0.89, 0.32, 1.28);
}
@keyframes takenPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.5); color: var(--gold, #FFD700); }
  100% { transform: scale(1); }
}

.game-center {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0; min-width: 0;
  width: 100%;
}
.game-side-panel {
  display: contents;
}

.players-row {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  box-sizing: border-box;
}
.players-row .strip { flex: 1 1 0; min-width: 0; min-height: 46px; padding: 6px 9px; overflow: hidden; }
.players-row .strip .who { font-size: 12px; }
.players-row .strip .seat { width: 26px; height: 26px; flex: 0 0 26px; }

.players-row .strip.me { order: 1; }
.players-row .score-mini { order: 2; }
.players-row .strip.opponent { order: 3; }

.score-mini {
  flex: 0 0 auto;
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(8,17,29,.82), rgba(22,31,43,.68));
  border: 1px solid rgba(226,169,59,.42);
  color: #FFF0D2;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .03em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 2px rgba(0,0,0,.9);
  white-space: nowrap;
  transition: transform 0.2s ease;
}
.score-mini.pulse { animation: scoreMiniPulse 0.5s ease-out; }
@keyframes scoreMiniPulse {
  0% { transform: scale(1); box-shadow: none; }
  40% {
    transform: scale(1.06);
    border-color: rgba(226,169,59,.85);
    box-shadow: 0 0 0 1px rgba(226,169,59,.5), 0 0 12px -2px rgba(226,169,59,.7);
  }
  100% { transform: scale(1); box-shadow: none; }
}

@media (orientation: landscape) and (max-height: 430px) {
  .players-row .strip .tray { display: none; }
  .players-row .strip .who small { display: none; }
  .players-row .strip { min-width: 34px; padding: 4px 6px; gap: 5px; }
  .players-row .strip .seat { width: 20px; height: 20px; flex: 0 0 20px; }
  .players-row .strip .taken { min-width: 14px; font-size: 12px; }
  .players-row .strip .move-timer { width: 26px; height: 26px; flex: 0 0 26px; }
  .players-row .strip .move-timer-num { font-size: 10px; }
  .score-mini { padding: 4px 8px; font-size: 12px; }
}

.ad-slot {
  display: none;
  align-items: center; justify-content: center;
  color: rgba(255,255,255,.28);
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  border: 1px dashed rgba(255,255,255,.14);
  border-radius: 12px;
  background: rgba(255,255,255,.02);
}

.replay-player-container {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  box-sizing: border-box;
}
.replay-slider-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 0 10px;
  box-sizing: border-box;
}
.replay-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  accent-color: #FFD56A;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.15);
}
.replay-bar {
  display: none;
  align-items: center; justify-content: center; gap: 8px;
  flex: 0 0 auto; width: 100%; max-width: 100%; margin: 0 auto; box-sizing: border-box;
}
.rep-nav-btn {
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.14);
  background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.02));
  color: var(--cream, #FFF2D4);
  cursor: pointer;
  transition: transform .12s ease, background .16s ease, opacity .16s ease;
}
.rep-play-btn {
  width: 48px; height: 48px;
  background: linear-gradient(180deg, #FCEABB, #D9A832);
  color: #1C0F00;
  border: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}
.rep-play-btn svg { width: 22px; height: 22px; fill: #1C0F00; stroke: none; }
.rep-nav-btn svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.rep-nav-btn:active { transform: translateY(2px) scale(.95); }
.rep-nav-btn:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.rep-nav-btn[disabled] { opacity: .32; pointer-events: none; }
.rep-counter {
  min-width: 60px; text-align: center;
  font: 900 13px var(--font); letter-spacing: .04em; color: #FFD56A;
  font-variant-numeric: tabular-nums;
}

body.replay-mode #net-status-banner { display: none !important; }
body.replay-mode #g-turn { display: none; }
body.replay-mode #rep-title { display: flex; }
body.replay-mode #g-settings { display: none; }
body.replay-mode .actionbar { display: none; }
body.replay-mode .replay-player-container { display: flex; }
body.replay-mode .replay-bar { display: flex; }
body.replay-mode .move-timer { display: none; }
body.replay-mode .score-mini { display: none; }
body.replay-mode .strip.turn { border-color: transparent; box-shadow: none; }

.board-wrap {
  flex: 1 1 auto;
  align-self: stretch;
  width: 100%;
  display: grid; place-items: center;
  min-height: 0; min-width: 0;
}
#board {
  display: block;
  border-radius: 16px;
  box-shadow: 0 22px 50px -18px rgba(0,0,0,.85), 0 0 0 1px rgba(226,169,59,.14);
  touch-action: none;
}

.actionbar { display: flex; gap: 8px; flex: 0 0 auto; width: 100%; max-width: 100%; margin: 0 auto; box-sizing: border-box; }
.actionbar.spectator-mode { justify-content: center; }
.actionbar.spectator-mode .act { flex: 0 1 200px; }
.act {
  flex: 1;
  min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 4px 8px;
  border-radius: var(--r-md);
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.035);
  color: var(--cream);
  font: 600 11px var(--font);
  letter-spacing: .04em;
  cursor: pointer;
  position: relative;
  transition: transform .12s ease, background .16s ease;
}
.act:active { transform: translateY(2px); }
.act:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.act[disabled] { opacity: .38; pointer-events: none; }
.act svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.act span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.act b {
  position: absolute; top: 4px; right: 6px;
  font-size: 10px; font-weight: 800; color: var(--brass);
}

.modal {
  position: fixed; inset: 0; z-index: 20;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(5, 10, 18, .74);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal.show { display: flex; animation: fade .2s ease both; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.card {
  width: 100%; max-width: 380px;
  padding: 26px 22px 20px;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--ink-3), var(--ink-2) 60%, var(--ink));
  border: 1px solid var(--line);
  box-shadow: 0 30px 70px -20px rgba(0,0,0,.9);
  text-align: center;
  animation: rise .28s cubic-bezier(.2,.9,.3,1) both;
}
@keyframes rise { from { transform: translateY(18px) scale(.97); opacity: 0 } to { transform: none; opacity: 1 } }
.card h2 { margin: 0 0 4px; font-size: 24px; letter-spacing: .04em; }
.card h2.win  { color: var(--brass-hi); }
.card h2.lose { color: var(--pome); }
.card h2.draw { color: var(--turq); }
.card p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }

.r-reason {
  margin: -10px 0 16px !important;
  font-size: 12.5px;
  font-weight: 700;
  color: #FF9B8C;
  background: rgba(255, 92, 77, .12);
  border: 1px solid rgba(255, 92, 77, .3);
  border-radius: 999px;
  padding: 5px 12px;
  display: inline-block;
}
.r-reason.win-reason {
  color: #FFE29A;
  background: rgba(226, 169, 59, .14);
  border-color: rgba(226, 169, 59, .35);
}

.result-stats {
  display: flex; justify-content: center; gap: 20px;
  margin: 14px 0 18px;
}
.result-stats div { text-align: center; }
.result-stats b { display: block; font-size: 20px; color: var(--cream); }
.result-stats span { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

.delta { font-size: 13px; font-weight: 700; }
.delta.up { color: var(--turq); }
.delta.down { color: var(--pome); }

.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-size: 14px; line-height: 1.5;
  color: #DCCFB6;
}
.list li:last-child { border-bottom: 0; }
.list li em {
  flex: 0 0 auto; width: 8px; height: 8px; margin-top: 7px;
  transform: rotate(45deg); background: var(--brass); opacity: .75;
}

.rowline {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-size: 15px;
}
.rowline:last-child { border-bottom: 0; }
.rowline > span { color: var(--muted); font-size: 13px; letter-spacing: .04em; }
.rowline > b { font-size: 17px; }

.lb-row {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.lb-row.me { color: var(--brass-hi); }
.lb-row .rank { width: 26px; font-weight: 800; color: var(--muted); font-size: 14px; text-align: right; }
.lb-row.me .rank { color: var(--brass); }
.lb-row img { width: 30px; height: 30px; border-radius: 50%; background: var(--ink-3); }
.lb-row .nm { flex: 1; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row .sc { font-weight: 800; font-size: 15px; }

.empty { text-align: center; color: var(--muted); padding: 30px 10px; font-size: 14px; line-height: 1.6; }

/* Akkauntsiz o'yinchi uchun izoh: o'z reytingi + "Войти" tugmasi.
   Jadval bo'sh bo'lsa ham, to'la bo'lsa ham eng pastda turadi. */
.lb-guest-note {
  margin-top: 14px; padding: 14px 16px 16px; text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 0 12px 12px;
  background: rgba(226, 169, 59, 0.07);
}
.lb-guest-rating { font-size: 15px; color: var(--muted); }
.lb-guest-rating b {
  font-size: 20px; color: var(--brass-hi, #E9C263); margin: 0 2px; letter-spacing: 0.01em;
}
.lb-guest-rating small { font-size: 12px; opacity: 0.75; }
.lb-guest-hint {
  margin: 6px 0 12px; font-size: 12.5px; line-height: 1.45; color: var(--muted); opacity: 0.9;
}
.lb-guest-btn { min-width: 150px; }

.screen-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 6px;
}
.screen-head h2 {
  flex: 1; margin: 0;
  font-size: 19px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--brass);
}

.rule-carousel {
  margin: 15px 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative; 
  min-height: 180px;
}

.carousel-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(10, 21, 35, 0.6);
  color: var(--brass);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s;
  position: absolute; 
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
}

#rule-prev { left: calc(50% - 130px); }
#rule-next { right: calc(50% - 130px); }

@media (max-width: 520px) {
  #rule-prev { left: 5px; }
  #rule-next { right: 5px; }
}

.carousel-btn:hover {
  background: rgba(226, 169, 59, 0.2);
  border-color: var(--brass);
}

.carousel-btn:active {
  transform: translateY(-50%) scale(0.9);
}

.carousel-btn svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rule-display {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.rule-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.rule-checker-img {
  width: 130px;
  height: 130px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.6));
}

.rule-opt span {
  font-size: 15px;
  font-weight: 800;
  color: var(--brass-hi);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
  margin-top: 5px;
  max-width: 200px; 
}

#btn-save-rules {
  background: linear-gradient(180deg, #f7e8c8 0%, #d9b45c 45%, #b38a36 100%) !important;
  color: #2b1d0e !important;
  border: 1px solid #ffebad !important;
  border-radius: 12px !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.6) !important;
  position: relative;
  padding: 12px 40px !important;
  min-height: 52px !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#btn-save-rules::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 35px;
  background: rgba(0,0,0,0.06);
  clip-path: polygon(30% 0, 100% 0, 100% 100%, 0% 100%);
  border-left: 1px solid rgba(0,0,0,0.1);
}

#btn-save-rules.btn-save-success {
  background: linear-gradient(180deg, #81c784 0%, #4caf50 45%, #2e7d32 100%) !important;
  color: #ffffff !important;
  border-color: #a5d6a7 !important;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.5) !important;
}

.carousel-btn {
  background: rgba(226, 169, 59, 0.1);
  border-color: var(--line);
  color: var(--brass);
}

.carousel-btn:hover {
  background: rgba(226, 169, 59, 0.2);
  border-color: var(--brass);
}

#toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b));
  transform: translateX(-50%) translateY(14px);
  z-index: 40;
  padding: 11px 18px;
  border-radius: 999px;
  background: rgba(10, 22, 38, .95);
  border: 1px solid var(--line);
  color: var(--cream);
  font-size: 13.5px; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  max-width: 86vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* TELEFON: taxta ekran chekkasiga yaqinroq tursin.
   Yon chekinish 10px -> 4px. Pastdagi tugmalar va o'yinchilar qatori ham
   shu kenglikni oladi, shuning uchun hammasi bir tekisda qoladi.
   800px dan keng ekranlarda (desktop) bu qoida ISHLAMAYDI. */
/* Yuklash ekranidagi qisqa tavsif (SEO uchun; izohi index.html da). */
#load-intro {
  max-width: 460px;
  margin: 10px auto 0;
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
  color: rgba(255, 242, 212, .55);
}
@media (max-width: 520px) { #load-intro { font-size: 11.5px; max-width: 320px; } }

@media (max-width: 799px) {
  #scr-game { padding: 8px 4px; }
  #board { border-radius: 10px; }
}

@media (max-width: 899px) {
  #scr-game .ad-slot--bottom {
    display: flex;
    flex: 0 0 auto;
    width: 100%;
    height: 50px;
    margin-top: 4px;
  }
}

@media (min-width: 800px) {
  .screen { padding: 10px 16px; }

  #scr-game.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 12px;
    gap: 6px;
    height: 100%;
    min-height: 0;
    max-height: var(--app-height, 100%);
    box-sizing: border-box;
    overflow: hidden;
  }

  #scr-game .topbar {
    width: 100%;
    max-width: 680px;
    min-height: 36px;
    margin: 0 auto;
  }

  #scr-game .game-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    max-width: 760px;
    flex: 1 1 auto;
    min-height: 0;
    margin: 0 auto;
  }

  #scr-game .players-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    flex: 0 0 auto;
  }

  #scr-game .board-wrap {
    flex: 1 1 auto;
    height: 100%;
    max-height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
  }

  #scr-game .actionbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
    flex: 0 0 auto;
  }

  #scr-game .actionbar .act {
    flex: 1;
    padding: 9px 8px;
    font-size: 12px;
    gap: 4px;
    flex-direction: column;
    justify-content: center;
    border-radius: 10px;
    min-height: 48px;
  }

  #scr-game .actionbar .act svg {
    width: 20px; height: 20px;
  }

  #scr-game .replay-player-container {
    width: 100%;
    flex: 0 0 auto;
  }

  #scr-game .replay-bar {
    width: 100%;
    justify-content: center;
  }

  #scr-game .ad-slot--left,
  #scr-game .ad-slot--right,
  #scr-game .ad-slot--bottom {
    display: none;
  }
}

.stats-drawer {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-8px);
  transition: max-height 0.38s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease,
              transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}
.stats-drawer.open {
  max-height: 450px;
  opacity: 1;
  transform: translateY(0);
}

.continue-net-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, rgba(243,196,94,.16), rgba(22,31,43,.7));
  border: 1px solid rgba(243,196,94,.55);
  box-shadow: 0 0 0 1px rgba(243,196,94,.12), 0 6px 18px -6px rgba(0,0,0,.5);
}
.continue-net-info { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.continue-net-dot {
  width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto;
  background: #6BE07A;
  box-shadow: 0 0 0 3px rgba(107,224,122,.22);
  animation: continueDotPulse 1.5s ease-in-out infinite;
}
@keyframes continueDotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}
.continue-net-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.continue-net-text b {
  font-size: 12.5px; color: #FFF0D2; text-shadow: 0 2px 2px rgba(0,0,0,.7);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.continue-net-text small {
  font-size: 11px; color: #F3C45E; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#continue-net-btn { width: auto; flex: 0 0 auto; padding: 9px 14px; font-size: 12.5px; }

.net-status-banner {
  display: none;
  align-items: center;
  gap: 8px;
  justify-content: center;
  padding: 8px 12px;
  margin: 0 0 6px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, rgba(231,76,60,.22), rgba(22,31,43,.75));
  border: 1px solid rgba(231,76,60,.55);
  color: #FFD9D2;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  animation: netBannerIn .25s ease-out;
}
.net-status-banner.show { display: flex; }
.net-status-banner.restored {
  background: linear-gradient(135deg, rgba(107,224,122,.22), rgba(22,31,43,.75));
  border-color: rgba(107,224,122,.55);
  color: #DFFCE4;
}
.net-status-dot {
  width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto;
  background: #e74c3c;
  animation: continueDotPulse 1s ease-in-out infinite;
}
.net-status-banner.restored .net-status-dot { background: #6BE07A; animation: none; }
@keyframes netBannerIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

#lb-body { display:flex; flex-direction:column; gap:9px; }
.lb-row {
  display:flex; align-items:center; gap:10px; min-height:58px; padding:8px 12px;
  border:1px solid rgba(255,255,255,.1); border-radius:14px;
  background:linear-gradient(135deg, rgba(255,255,255,.07), rgba(255,255,255,.025));
  color:#FFF2D4; box-sizing:border-box;
}
.lb-row .rank { width:30px; text-align:center; color:#E2A93B; font-size:18px; font-weight:900; }
.lb-row img { width:36px; height:36px; border-radius:50%; background:rgba(255,255,255,.08); object-fit:cover; }
.lb-row .nm { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:800; }
.lb-row .sc { min-width:54px; text-align:right; color:#FFD978; font-size:17px; font-weight:900; }
.lb-row.top-1 { min-height:70px; border-color:#FFD978; background:linear-gradient(135deg, rgba(255,215,80,.25), rgba(166,104,16,.16)); box-shadow:0 0 18px rgba(255,215,80,.14); }
.lb-row.top-2 { border-color:#C9D2DC; background:linear-gradient(135deg, rgba(201,210,220,.2), rgba(255,255,255,.04)); }
.lb-row.top-3 { border-color:#D98A4A; background:linear-gradient(135deg, rgba(217,138,74,.2), rgba(255,255,255,.04)); }
.lb-row.top-1 .rank { color:#FFD700; font-size:23px; }
.lb-row.top-2 .rank { color:#DCE6EF; font-size:21px; }
.lb-row.top-3 .rank { color:#E59A5C; font-size:21px; }
.lb-row.me { outline:1px solid rgba(226,169,59,.65); }

.profile-header-card { position: relative; justify-content: flex-start !important; }
.profile-card-edit {
  position: static;
  transform: none;
  flex: 0 0 auto;
  margin-left: 6px;
}
.profile-header-card > div:last-child { margin-left: auto; }

#lb-body { display:block; max-width:760px; margin:0 auto; overflow-x:hidden; }
.lb-hero {
  display:flex; align-items:center; justify-content:center; gap:10px; margin:2px 0 15px;
  color:#FFE4A0; text-align:left; text-shadow:0 2px 3px rgba(0,0,0,.8);
}
.lb-hero > span { font-size:28px; color:#FFD15A; filter:drop-shadow(0 3px 3px rgba(0,0,0,.6)); }
.lb-hero b { display:block; font-size:14px; letter-spacing:.16em; }
.lb-hero small { display:block; margin-top:1px; color:rgba(255,242,212,.62); font-size:10px; text-transform:uppercase; letter-spacing:.12em; }
.lb-podium {
  display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:10px; align-items:end;
  padding:22px 10px 10px; margin-bottom:14px; border-radius:22px;
  background:linear-gradient(180deg, rgba(6,15,29,.78), rgba(15,9,5,.45));
  border:1px solid rgba(226,169,59,.35); box-shadow:inset 0 1px 0 rgba(255,225,147,.12), 0 12px 30px rgba(0,0,0,.22);
}
.podium-card {
  position:relative; min-width:0; min-height:153px; padding:17px 8px 12px; border-radius:16px;
  text-align:center; color:#FFF2D4; border:1px solid rgba(255,255,255,.15);
  background:linear-gradient(150deg, rgba(70,90,119,.45), rgba(16,23,35,.93));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.13), 0 8px 15px rgba(0,0,0,.26);
  overflow:visible;
}
.podium-card::after { content:""; position:absolute; left:12%; right:12%; bottom:0; height:5px; border-radius:5px 5px 0 0; background:rgba(255,255,255,.18); }
.podium-1 { min-height:179px; padding-top:26px; border-color:#FFE07B; background:linear-gradient(160deg, rgba(242,181,43,.7), rgba(102,59,9,.96)); box-shadow:inset 0 1px 0 rgba(255,246,190,.5), 0 10px 24px rgba(240,180,45,.27); }
.podium-2 { min-height:159px; border-color:#D8E2EC; background:linear-gradient(160deg, rgba(174,191,207,.56), rgba(48,60,73,.95)); }
.podium-3 { min-height:159px; border-color:#DF9A62; background:linear-gradient(160deg, rgba(184,103,51,.66), rgba(82,43,27,.96)); }
/* MEDAL = o'rin raqami (1/2/3). Ilgari ♛ / ★ / ◆ belgilari turardi va
   qaysi o'rin ekani bilinmasdi. Doira metall ko'rinishida: yuqoridan
   yorug', pastdan qorong'i gradient + ::after bilan yorug'lik aksi. */
.podium-medal {
  position:absolute; top:-19px; left:50%; transform:translateX(-50%);
  width:38px; height:38px; display:grid; place-items:center; border-radius:50%;
  font-size:19px; font-weight:900; line-height:1; letter-spacing:0;
  color:#26313F; text-shadow:0 1px 0 rgba(255,255,255,.45);
  background:linear-gradient(160deg,#FDFEFF 8%,#C9D5E1 46%,#8494A6 100%);
  border:2px solid rgba(255,255,255,.9);
  box-shadow:0 5px 12px rgba(0,0,0,.5), inset 0 -3px 7px rgba(0,0,0,.22);
}
.podium-medal::after {
  content:""; position:absolute; top:3px; left:23%; right:23%; height:32%;
  border-radius:50%; pointer-events:none;
  background:linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,0));
}
.podium-1 .podium-medal {
  width:48px; height:48px; top:-25px; font-size:25px; color:#4A2E05;
  background:linear-gradient(160deg,#FFF3B0 8%,#FFCF4A 46%,#A9740E 100%);
  border-color:#FFF6C9;
  box-shadow:0 6px 15px rgba(0,0,0,.5), 0 0 17px rgba(255,206,74,.45), inset 0 -3px 8px rgba(0,0,0,.2);
}
.podium-3 .podium-medal {
  color:#3A1D07;
  background:linear-gradient(160deg,#FFD3A6 8%,#E08A45 46%,#8A4A18 100%);
  border-color:#FFDCB6;
}
.lb-avatar { width:54px !important; height:54px !important; margin:0 auto 6px; border-radius:50%; object-fit:cover; box-sizing:border-box; border:2px solid rgba(255,248,219,.7); box-shadow:0 4px 10px rgba(0,0,0,.38); }
.lb-avatar-fallback { display:grid; place-items:center; background:linear-gradient(145deg,#355071,#172538); color:#FFDB76; font-size:16px; font-weight:900; letter-spacing:.03em; }
.podium-1 .lb-avatar-fallback { background:linear-gradient(145deg,#784a14,#2D1A06); color:#FFF2C3; }
.podium-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; font-weight:900; text-shadow:0 2px 2px rgba(0,0,0,.55); }
.podium-score { margin-top:5px; color:#FFF5CA; font-size:17px; font-weight:900; text-shadow:0 2px 2px rgba(0,0,0,.55); }
.podium-score small { display:block; margin-top:1px; color:rgba(255,245,202,.74); font-size:8px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.lb-list { display:flex; flex-direction:column; gap:8px; padding: 0 10px 12px; }
.lb-row { min-height:64px; padding:7px 10px; border-radius:15px; border-color:rgba(226,169,59,.22); background:linear-gradient(100deg, rgba(8,17,30,.79), rgba(62,40,25,.55)); box-shadow:inset 0 1px 0 rgba(255,255,255,.06); transition:transform .16s ease, border-color .16s ease; }
.lb-row:hover { transform:translateX(3px); border-color:rgba(255,215,116,.62); }
.lb-row .rank { display:grid; place-items:center; width:30px; height:30px; border-radius:9px; color:#FFD56A; font-size:14px; background:rgba(226,169,59,.14); }
.lb-row .lb-avatar { flex:0 0 auto; width:42px !important; height:42px !important; margin:0; font-size:12px; }
.lb-row .nm { font-size:15px; color:#FFF4D5; }
.lb-row .sc { min-width:auto; padding:8px 10px; border-radius:10px; color:#FFE18B; font-size:15px; background:rgba(226,169,59,.15); border:1px solid rgba(255,224,123,.18); }
.lb-row .sc span { display:block; margin-top:1px; color:rgba(255,239,196,.58); font-size:8px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.lb-row.me {
  border-color: #FFD56A;
  background: linear-gradient(100deg, rgba(226, 169, 59, 0.3), rgba(30, 40, 55, 0.95));
  box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 15px rgba(255, 213, 106, 0.25), inset 0 1px 0 rgba(255,255,255,0.15);
  transform: scale(1.04);
  z-index: 10;
  position: relative;
  margin: 6px 4px;
  border-width: 1.5px;
}

.lb-row.me .rank {
  background: #FFD56A;
  color: #3E2819;
  font-weight: 900;
  box-shadow: 0 0 10px rgba(255, 213, 106, 0.4);
}

.lb-row.me .nm {
  color: #FFD56A;
  font-weight: 800;
  font-size: 16px;
}

.lb-row.me .sc {
  background: rgba(255, 213, 106, 0.2);
  border-color: rgba(255, 213, 106, 0.4);
  transform: scale(1.05);
}

/* O'ZINGIZNING kartangiz. transform:scale() ATAYLAB YO'Q: karta
   kattalashsa podium qatoridan chiqib ketardi. Ajratib ko'rsatish faqat
   RANG bilan - oltin ramka va nur. (box-sizing:border-box global,
   shuning uchun 2px ramka kartaning tashqi o'lchamini o'zgartirmaydi.) */
.podium-card.me {
  box-shadow: 0 0 25px rgba(255, 213, 106, 0.4);
  z-index: 15;
  border: 2px solid #FFD56A;
}

/* Shrift o'lchami OSHIRILMAYDI - ism uzun bo'lsa kartaga sig'masdi. */
.podium-card.me .podium-name {
  color: #FFD56A;
}

/* "ВЫ" YORLIG'I. Ilgari ism qatoriga qo'shilardi ("Ism (Вы)") va bir xil
   shriftda bo'lgani uchun ismning davomiday o'qilardi. Endi bu kichkina
   oltin yorliq: boshqa o'lcham, boshqa fon - ism bilan aralashmaydi. */
.lb-you {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9.5px; font-weight: 900; line-height: 1.4;
  letter-spacing: .12em; text-transform: uppercase; font-style: normal;
  color: #3A2604;
  background: linear-gradient(180deg, #FFE9A8, #E2A93B);
  border: 1px solid rgba(255, 246, 201, .75);
  box-shadow: 0 2px 5px rgba(0, 0, 0, .35);
}
/* KARTADA yorliq pastki chekkada LENTA bo'lib turadi va kartaning o'z
   "zina" chizig'i (::after) o'rnini egallaydi.
   Nega burchakda EMAS: telefonda karta ~107px, markazdagi medal 38-48px
   joy egallaydi - burchakdagi yorliq unga tegib ketardi.
   Lenta sig'ishi uchun uchala kartaning min-height i BIR XIL miqdorda
   oshirilgan (pastda ~10px bo'sh joy) - balandliklar teng qoladi. */
.podium-card .lb-you {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 3px 0; text-align: center;
  border: 0; border-top: 1px solid rgba(255, 246, 201, .7);
  border-radius: 0 0 14px 14px;
  box-shadow: none;
}
.podium-card.me::after { display: none; }

@media (max-width:520px) {
  .lb-podium { gap:5px; padding:20px 5px 7px; border-radius:17px; }
  .podium-card { min-height:136px; padding:15px 4px 9px; border-radius:12px; }
  .podium-1 { min-height:157px; padding-top:23px; }
  .podium-2 { min-height:142px; }
  .podium-3 { min-height:142px; }
  /* Karta radiusi 12px, ramka 2px -> ichki radius 10px */
  .podium-card .lb-you { border-radius: 0 0 10px 10px; }
  .lb-avatar { width:44px !important; height:44px !important; font-size:13px; }
  .podium-name { font-size:11px; }
  .podium-score { font-size:14px; }
  .lb-row { min-height:57px; gap:8px; padding:6px 7px; }
  .lb-row .lb-avatar { width:37px !important; height:37px !important; }
  .lb-row .nm { font-size:13px; }
  .lb-row .sc { padding:6px 7px; font-size:13px; }
}

.radar-box {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(226, 169, 59, 0.1) 0%, transparent 70%);
  border: 1px solid rgba(226, 169, 59, 0.2);
  overflow: hidden;
  margin: 15px auto;
  box-shadow: 0 0 20px rgba(226, 169, 59, 0.15), inset 0 0 15px rgba(226, 169, 59, 0.1);
}

.radar-circle {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 70%; height: 70%;
  border-radius: 50%;
  border: 1px dashed rgba(226, 169, 59, 0.3);
  animation: radar-pulse 2s ease-out infinite;
}

.radar-circle:nth-child(2) {
  width: 40%; height: 40%;
  animation-delay: 0.5s;
}

.radar-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #FFD56A;
  box-shadow: 0 0 15px #FFD56A, 0 0 30px rgba(255, 213, 106, 0.5);
  z-index: 5;
}

.radar-scanner {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: conic-gradient(from 0deg, rgba(226, 169, 59, 0.6) 0deg, rgba(226, 169, 59, 0.1) 60deg, transparent 120deg);
  animation: radar-spin 1.8s linear infinite;
  border-radius: 50%;
}

.radar-glint {
  position: absolute;
  width: 4px; height: 4px;
  background: #FFD56A;
  border-radius: 50%;
  filter: blur(1px);
  opacity: 0;
}

.radar-glint:nth-child(4) { animation: radar-target-1 4s infinite; }
.radar-glint:nth-child(5) { animation: radar-target-2 5s infinite 1.2s; }
.radar-glint:nth-child(6) { animation: radar-target-3 6s infinite 2.5s; }

@keyframes radar-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes radar-pulse { 0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.8; } 100% { transform: translate(-50%, -50%) scale(1.4); opacity: 0; } }

@keyframes radar-target-1 {
  0% { opacity: 0; transform: translate(20px, 20px) scale(0); }
  20% { opacity: 0.8; transform: translate(25px, 22px) scale(1.2); }
  40% { opacity: 0; transform: translate(30px, 25px) scale(0); }
  100% { opacity: 0; }
}

@keyframes radar-target-2 {
  0% { opacity: 0; transform: translate(70px, 40px) scale(0); }
  30% { opacity: 0.7; transform: translate(65px, 45px) scale(1); }
  50% { opacity: 0; transform: translate(60px, 50px) scale(0); }
  100% { opacity: 0; }
}

@keyframes radar-target-3 {
  0% { opacity: 0; transform: translate(40px, 80px) scale(0); }
  25% { opacity: 0.9; transform: translate(45px, 75px) scale(1.3); }
  45% { opacity: 0; transform: translate(50px, 70px) scale(0); }
  100% { opacity: 0; }
}

.rules-section { margin-top: 20px; }
.rules-header { display: flex; align-items: center; justify-content: center; gap: 10px; color: #FFD56A; font-weight: 900; font-size: 12px; margin-bottom: 12px; letter-spacing: 2px; }
.rules-header i { font-style: normal; font-size: 8px; opacity: 0.6; }
/* ================= QOIDALAR — "QOIDALAR KITOBI" USLUBI =================
   Eski kitobning pergament varag'i: ikki qavat hoshiya, serif yozuv,
   jigarrang siyoh va guruch muhr. */
.rules-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

.rule-card {
  display: flex; flex-direction: row; align-items: center; gap: 11px;
  padding: 11px 13px; position: relative; cursor: pointer;
  min-width: 0; overflow: visible; -webkit-tap-highlight-color: transparent;
  border-radius: 6px;
  background: linear-gradient(180deg, #EDE0C4, #DCCBA6 70%, #CDB98F);
  border: 1px solid #9C7B45;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, transform 0.16s ease;
}
/* Varaq ichidagi ikkinchi nozik hoshiya (kitob sahifasidagidek) */
.rule-card::after {
  content: ''; position: absolute; inset: 4px; border-radius: 3px;
  border: 1px solid rgba(120, 90, 45, 0.35); pointer-events: none;
}
.rule-card:hover { border-color: #B8862B; }
.rule-card:active { transform: scale(0.985); }

/* Tanlangan varaq - yorishadi va guruch hoshiya oladi */
.rule-card.active {
  background: linear-gradient(180deg, #FFF6DF, #F0E0BB 70%, #E0CDA2);
  border-color: #B8862B;
  box-shadow: 0 0 0 2px rgba(226, 169, 59, 0.42), 0 6px 14px rgba(0, 0, 0, 0.5),
              inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.rule-card.active::after { border-color: rgba(150, 110, 45, 0.45); }

/* Bayroq - kitobga bosilgan muhr */
.rule-card .rule-flag {
  width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 50%; object-fit: cover; display: block;
  border: 2px solid #8A6A38; background: #EDE0C4;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: border-color 0.2s ease, filter 0.2s ease;
  filter: saturate(0.9);
}
.rule-card.active .rule-flag { border-color: #B8862B; filter: none; }
.rule-icon { font-size: 22px; line-height: 22px; }

/* O'ngdagi muhr uchun joy: 11px chekinish + 25px muhr + 4px nafas */
.rule-text { flex: 1 1 auto; min-width: 0; padding-right: 40px; }

/* Nomi - kitobdagidek serif, jigarrang siyoh */
.rule-name {
  display: block; font-family: Georgia, "Times New Roman", "Noto Serif", serif;
  font-size: 14px; font-weight: 700; letter-spacing: 0.01em; line-height: 1.2;
  color: #3B2A12; text-align: left;
  word-break: break-word; overflow-wrap: break-word;
}
.rule-card.active .rule-name { color: #2A1B06; }

/* Taxta o'lchami va shashkalar soni */
.rule-meta {
  font-family: Georgia, "Times New Roman", "Noto Serif", serif;
  font-size: 10.5px; color: #7A5F32; margin-top: 2px; letter-spacing: 0.02em;
  white-space: nowrap;
}
.rule-card.active .rule-meta { color: #6B4E23; }

/* O'yinchilar soni - sahifaga bosilgan dumaloq muhr */
.rule-badge {
  position: absolute; top: 50%; right: 11px; transform: translateY(-50%); z-index: 2;
  width: 25px; height: 25px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: Georgia, "Times New Roman", serif; font-size: 12px; font-weight: 700;
  color: #6B4E23; background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(120, 90, 45, 0.5); line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  /* `all` emas: aks holda o'lcham ham animatsiya bo'lib, karta "sakraydi" */
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.rule-card.active .rule-badge {
  background: linear-gradient(180deg, #D9A832, #A97C22);
  color: #FFF6DF; border-color: #8A6216;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 235, 190, 0.5);
}

@media (max-width: 420px) {
  .rules-grid { gap: 8px; }
  .rule-card { padding: 9px 10px; gap: 9px; }
  .rule-name { font-size: 12.5px; }
  .rule-meta { font-size: 9.5px; }
  .rule-text { padding-right: 32px; }
  .rule-card .rule-flag { width: 30px; height: 30px; flex-basis: 30px; }
  .rule-badge { width: 22px; height: 22px; right: 8px; font-size: 11px; }
}

.premium-id-box {
  margin-top: 20px; display: flex; align-items: center; justify-content: center; gap: 20px;
  padding: 15px; background: rgba(0,0,0,0.2); border: 1px solid rgba(226, 169, 59, 0.2);
  border-radius: 16px; color: #FFD56A; cursor: pointer;
}
.premium-id-deco { font-size: 10px; opacity: 0.5; letter-spacing: 2px; }
.premium-id-main { text-align: center; }
.premium-id-main small { display: block; font-size: 10px; font-weight: 800; margin-bottom: 4px; opacity: 0.7; }
.premium-id-row { display: flex; align-items: center; gap: 8px; }
.premium-id-row b { font-size: 22px; font-family: monospace; letter-spacing: 2px; }

/* ================= LOBBI — "QOIDALAR KITOBI" USLUBI =================
   Qoida kartalari bilan bir xil pergament varaq: jigarrang hoshiya,
   serif yozuv, guruch urg'ular. */
.premium-lobby-card {
  margin-top: 20px; padding: 0; position: relative; overflow: hidden;
  background: linear-gradient(180deg, #EDE0C4, #DCCBA6 70%, #CDB98F);
  border: 1px solid #9C7B45;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
/* Sahifa ichidagi ikkinchi hoshiya */
.premium-lobby-card::after {
  content: ''; position: absolute; inset: 4px; border-radius: 4px;
  border: 1px solid rgba(120, 90, 45, 0.32); pointer-events: none; z-index: 3;
}

/* ---- Bo'limlar: kitobning mundarija sarlavhasi ---- */
.lobby-tabs-header {
  display: flex; position: relative; margin: 10px 10px 0; padding: 0;
  background: none; border: none;
  border-bottom: 1px solid rgba(120, 90, 45, 0.45);
}
/* Sirg'aluvchi guruch xatcho'p lentasi */
.lobby-tabs-header::before {
  content: ''; position: absolute; z-index: 2;
  bottom: -1px; left: 0; width: 50%; height: 3px; border-radius: 2px 2px 0 0;
  background: linear-gradient(90deg, transparent, #C9932F 18%, #8A6216 50%, #C9932F 82%, transparent);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1), background 0.25s ease;
}
.lobby-tabs-header.on-games::before {
  transform: translateX(100%);
  background: linear-gradient(90deg, transparent, #B4453A 18%, #8C2F28 50%, #B4453A 82%, transparent);
}

.lobby-tab {
  flex: 1; padding: 10px 6px 11px; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; box-shadow: none; position: relative; z-index: 1;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease;
}
.lobby-tab + .lobby-tab { border-left: 1px solid rgba(120, 90, 45, 0.3); }
.lobby-tab.active { background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0)); }
.lobby-tab:not(.active):hover { background: rgba(255, 255, 255, 0.16); }

.lobby-tab-top {
  display: flex; align-items: center; gap: 6px;
  font-family: Georgia, "Times New Roman", "Noto Serif", serif;
  font-weight: 700; font-size: 13.5px; letter-spacing: 0.01em;
  color: #8A7350; text-shadow: none; transition: color 0.2s ease;
}
.lobby-tab.active .lobby-tab-top { color: #3B2A12; }
#tab-btn-games.active .lobby-tab-top { color: #7A2B24; }
.lobby-tab:not(.active):hover .lobby-tab-top { color: #6B5738; }
.lobby-tab small {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10px; color: #8A7350; opacity: 0.75; letter-spacing: 0.01em;
  transition: opacity 0.2s ease;
}
.lobby-tab.active small { opacity: 1; color: #7A5F32; }
.dot { width: 7px; height: 7px; border-radius: 50%; }
.dot.green { background: #2E9E5B; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15); }
.dot.red { background: #B4453A; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15); }

.lobby-list {
  display: flex; flex-direction: column; gap: 8px;
  min-height: 210px; max-height: 360px; overflow-y: auto;
  padding: 12px 11px; position: relative; z-index: 2;
}
.lobby-list::-webkit-scrollbar { width: 5px; }
.lobby-list::-webkit-scrollbar-thumb { background: rgba(120, 90, 45, 0.45); border-radius: 3px; }

/* Ro'yxat bo'sh bo'lsa - kitobdagi izoh kabi */
.lobby-empty {
  text-align: center; font-family: Georgia, "Times New Roman", serif;
  font-size: 13px; font-style: italic; margin: auto 0;
  color: #7A5F32; opacity: 0.8; letter-spacing: 0.01em;
}

/* ---- O'yinchi qatori: daftardagi yozuv ---- */
.lobby-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 11px; position: relative; min-width: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.12));
  border: 1px solid rgba(120, 90, 45, 0.4); border-radius: 5px;
  box-shadow: 0 1px 3px rgba(90, 65, 25, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.lobby-item:hover {
  border-color: #B8862B;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.25));
}

.lobby-item-info { display: flex; align-items: center; gap: 10px; min-width: 0; overflow: hidden; flex: 1; cursor: pointer; }

/* Avatar - kitobga bosilgan muhr (qoida bayroqlari bilan bir xil) */
.lobby-avatar-wrap { position: relative; flex-shrink: 0; }
.lobby-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(160deg, #E7D8B6, #CDB98F);
  border: 2px solid #8A6A38;
  display: flex; align-items: center; justify-content: center;
  font-family: Georgia, "Times New Roman", serif;
  color: #4A3413; font-weight: 700; font-size: 13px; letter-spacing: 0.02em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.lobby-avatar-dot {
  position: absolute; bottom: -1px; right: -1px; width: 10px; height: 10px;
  border-radius: 50%; border: 2px solid #EDE0C4;
}
.lobby-avatar-dot.on { background: #2E9E5B; }
.lobby-avatar-dot.busy { background: #B4453A; }

.lobby-item-text { display: flex; flex-direction: column; min-width: 0; flex: 1; justify-content: center; gap: 1px; }
.lobby-name-row { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.lobby-name {
  font-family: Georgia, "Times New Roman", "Noto Serif", serif;
  font-size: 14px; font-weight: 700; color: #3B2A12; letter-spacing: 0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: none;
}
.lobby-status {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10.5px; color: #7A5F32; opacity: 0.85; white-space: nowrap; font-weight: 400;
}
.lobby-rating {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11.5px; font-weight: 700; color: #6B4E23;
  display: inline-flex; align-items: center; gap: 4px; letter-spacing: 0.01em; text-shadow: none;
}

/* "Вызвать" - guruch quyma tugma */
.lobby-challenge-btn {
  width: auto; min-width: 96px; padding: 8px 14px; flex: 0 0 auto; white-space: nowrap;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em; border-radius: 5px;
  background: linear-gradient(180deg, #E9C263, #C9932F 55%, #A97C22);
  color: #33220A; border: 1px solid #8A6216; cursor: pointer;
  box-shadow: 0 2px 5px rgba(90, 65, 25, 0.45), inset 0 1px 0 rgba(255, 245, 214, 0.6);
  text-shadow: 0 1px 0 rgba(255, 245, 214, 0.4);
  transition: filter 0.15s ease, transform 0.15s ease;
}
.lobby-challenge-btn:hover { filter: brightness(1.07); }
.lobby-challenge-btn:active { transform: scale(0.97); }
.lobby-challenge-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Jonli o'yinlar: qizil siyoh bilan yozilgan qator ---- */
.live-game-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 11px; position: relative; min-width: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.1));
  border: 1px solid rgba(140, 47, 40, 0.35); border-radius: 5px;
  box-shadow: 0 1px 3px rgba(90, 65, 25, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.live-game-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.live-game-title {
  display: flex; align-items: baseline; gap: 6px; min-width: 0;
  font-family: Georgia, "Times New Roman", serif; font-size: 13.5px; font-weight: 700; color: #3B2A12;
}
.live-game-player {
  font-family: Georgia, "Times New Roman", serif;
  color: #3B2A12; font-weight: 700; font-size: 13.5px; cursor: pointer; text-shadow: none;
  border-bottom: 1px solid rgba(120, 90, 45, 0.45);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42%;
}
.live-game-vs {
  font-family: Georgia, "Times New Roman", serif;
  color: #8C2F28; font-weight: 700; font-size: 12px; letter-spacing: 0.06em; margin: 0 2px;
}
.live-game-watch {
  width: auto; padding: 7px 12px; flex: 0 0 auto; white-space: nowrap;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; border-radius: 5px;
  background: linear-gradient(180deg, #C4655B, #8C2F28);
  color: #FFF0EC; border: 1px solid #6E241E; cursor: pointer;
  box-shadow: 0 2px 5px rgba(90, 40, 30, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}
.live-game-watch:hover { filter: brightness(1.08); }

@media (max-width: 420px) {
  .lobby-item, .live-game-item { padding: 8px 9px; gap: 8px; }
  .lobby-avatar { width: 33px; height: 33px; font-size: 12px; }
  .lobby-name { font-size: 13px; }
  .lobby-challenge-btn { min-width: 78px; padding: 7px 10px; font-size: 11.5px; }
  .lobby-list { min-height: 180px; max-height: 300px; padding: 10px 9px; }
  .lobby-tabs-header { margin: 9px 9px 0; }
  .lobby-tab { padding: 8px 4px 9px; }
  .lobby-tab-top { font-size: 12.5px; }
}

/* ================= ONLAYN EKRAN — YANGI JOYLASHUV =================
   Kitob/pergament uslubi: guruch urg'ular, serif sarlavhalar. */

/* ---- 1) Yuqori holat paneli ---- */
.ob-statusbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px;
  padding: 9px 13px; margin-bottom: 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(226, 169, 59, 0.25); border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, 0.06);
}
.ob-stat {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.02em;
}
.ob-stat b { color: var(--cream); font-size: 13px; font-variant-numeric: tabular-nums; }
.ob-idbox {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; color: var(--muted);
}
.ob-idbox b {
  color: var(--brass-hi); font-family: ui-monospace, "Consolas", monospace;
  font-size: 13px; letter-spacing: 0.08em;
}
.ob-copy {
  padding: 4px 10px; border-radius: 7px; cursor: pointer;
  background: rgba(226, 169, 59, 0.14); border: 1px solid rgba(226, 169, 59, 0.4);
  color: var(--brass-hi); font-size: 11px; font-weight: 800; letter-spacing: 0.02em;
  transition: background 0.15s ease;
}
.ob-copy:hover { background: rgba(226, 169, 59, 0.26); }

/* ---- 2) Ikkita asosiy karta ---- */
.ob-hero { display: grid; grid-template-columns: 1.35fr 1fr; gap: 12px; margin-bottom: 22px; }

.ob-card {
  position: relative; padding: 16px 18px; border-radius: 8px;
  display: flex; flex-direction: column; align-items: flex-start;
}
.ob-card::after {
  content: ''; position: absolute; inset: 4px; border-radius: 4px;
  border: 1px solid rgba(120, 90, 45, 0.3); pointer-events: none;
}

/* Chapdagi asosiy karta - o'yilgan yog'och taxta */
.ob-card-main {
  background:
    repeating-linear-gradient(96deg, rgba(0, 0, 0, 0.13) 0 3px, rgba(255, 255, 255, 0.022) 3px 7px),
    linear-gradient(180deg, #5C3A1C, #3A2210 70%, #2B1809);
  border: 1px solid rgba(226, 169, 59, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 214, 150, 0.18), 0 5px 14px rgba(0, 0, 0, 0.5);
}
.ob-card-main::after { border-color: rgba(226, 169, 59, 0.18); }

/* O'ngdagi karta - pergament varaq */
.ob-card-side {
  background: linear-gradient(180deg, #EDE0C4, #DCCBA6 70%, #CDB98F);
  border: 1px solid #9C7B45;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.ob-kicker {
  font-size: 10px; font-weight: 900; letter-spacing: 0.18em; text-transform: uppercase;
  margin-bottom: 6px;
}
.ob-card-main .ob-kicker { color: rgba(255, 221, 138, 0.65); }
.ob-card-side .ob-kicker { color: #9C7B45; }

.ob-title {
  margin: 0 0 7px; font-family: Georgia, "Times New Roman", "Noto Serif", serif;
  font-size: 21px; font-weight: 700; line-height: 1.15; letter-spacing: 0.01em;
}
.ob-card-main .ob-title { color: #FFF6DF; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6); }
.ob-card-side .ob-title { color: #3B2A12; }

.ob-desc { margin: 0 0 12px; font-size: 12.5px; line-height: 1.5; max-width: 34em; }
.ob-card-main .ob-desc { color: rgba(243, 231, 208, 0.72); }
.ob-card-side .ob-desc { color: #7A5F32; font-family: Georgia, "Times New Roman", serif; }
.ob-desc-rule { display: inline-block; }
.ob-desc-rule b { color: var(--brass-hi); }

.ob-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.ob-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 7px;
  background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(226, 169, 59, 0.28);
  color: rgba(243, 231, 208, 0.85); font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
}

.ob-btn-main {
  margin-top: auto; padding: 12px 26px; border-radius: 7px; cursor: pointer;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px; font-weight: 700; letter-spacing: 0.02em;
  background: linear-gradient(180deg, #E9C263, #C9932F 55%, #A97C22);
  color: #33220A; border: 1px solid #8A6216;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 245, 214, 0.6);
  text-shadow: 0 1px 0 rgba(255, 245, 214, 0.4);
  transition: filter 0.15s ease, transform 0.15s ease;
}
.ob-btn-main:hover { filter: brightness(1.07); }
.ob-btn-main:active { transform: scale(0.98); }

.ob-btn-ghost {
  margin-top: auto; width: 100%; padding: 11px 20px; border-radius: 7px; cursor: pointer;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px; font-weight: 700; letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.35); color: #3B2A12;
  border: 1px solid #9C7B45;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.ob-btn-ghost:hover { background: rgba(255, 255, 255, 0.62); border-color: #B8862B; }
.ob-btn-ghost:active { transform: scale(0.98); }

/* ---- 3) Bo'lim sarlavhasi ---- */
.ob-section-head {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 10px;
}
.ob-section-head h3 {
  margin: 0; font-family: Georgia, "Times New Roman", "Noto Serif", serif;
  font-size: 17px; font-weight: 700; color: var(--brass-hi); letter-spacing: 0.01em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.ob-section-head small { font-size: 11.5px; color: var(--muted); letter-spacing: 0.01em; }

/* Qoida kartalari endi bitta qatorda (4 ta) */
.rules-grid { grid-template-columns: repeat(4, 1fr); }
.rule-card { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 13px 13px; }
.rule-desc {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px; line-height: 1.4; color: #6B4E23; margin-top: 5px;
}
.rule-card .rule-flag { width: 40px; height: 40px; flex-basis: auto; }
.rule-text { padding-right: 0; }
.rule-badge { top: 11px; right: 11px; transform: none; }

/* ---- Telefon: onlayn ekranning YUQORI qismi siqiladi -------------
   MUAMMO: sarlavha ostidagi "Мой ID" qatori, bezak chizig'i va
   kartalarning katta ichki bo'shliqlari ekranning yarmini egallar,
   o'yinchilar jadvali (lobbi) esa pastda ko'rinmay qolardi - odam uni
   umuman yo'q deb o'ylashi mumkin edi.
   YECHIM: mobil ekranda "Мой ID" qatori va bezak olib tashlanadi
   (ID endi "Ввести ID" oynasida ko'rsatiladi), kartalar esa siqiladi.
   Kompyuter ko'rinishi O'ZGARMAYDI. */
/* "Мой ID" onlayn ekranda umuman ko'rsatilmaydi - u faqat PROFILDA
   turadi (u yerda bosilsa nusxalanadi ham). Ilgari u sarlavha qatorida
   turar va ayniqsa telefonda ko'p joy egallardi. */
#scr-online-setup .ob-idbox { display: none; }

@media (max-width: 900px) {
  #scr-online-setup .rule { display: none; }
  #scr-online-setup .screen-head { margin-bottom: 4px; }
  #scr-online-setup .ob-hero { gap: 9px; margin-bottom: 12px; }
  #scr-online-setup .ob-card { padding: 11px 13px; }
  #scr-online-setup .ob-title { font-size: 18px; margin-bottom: 4px; }
  #scr-online-setup .ob-desc { margin-bottom: 9px; font-size: 12px; }
  #scr-online-setup .ob-btn-main,
  #scr-online-setup .ob-btn-ghost { padding: 10px 16px; }
  #scr-online-setup .ob-section-head { margin: 10px 0 8px; }
}

/* ---- Telefon: qoida kartalari past bo'lsin -----------------------
   MUAMMO: onlayn ekranda kartalar ustunga (bayroq tepada, nomi pastda)
   o'giriladi. Telefonda shu tufayli kartalar juda baland bo'lib,
   o'yinchilar jadvali (lobbi) ekrandan butunlay chiqib ketardi -
   pastga surmagan odam uning borligini ham bilmasdi.
   YECHIM: nomni toshning TAGIGA emas, YONIGA qo'yamiz. Bayroq
   o'lchami O'ZGARMAYDI (u allaqachon kichkina), lekin karta balandligi
   ~40% ga qisqaradi va lobbi kartasining yuqori qismi ko'rinib turadi. */
@media (max-width: 900px) {
  #scr-online-setup .rules-grid { gap: 8px; }
  #scr-online-setup .rule-card {
    flex-direction: row; align-items: center; gap: 10px; padding: 8px 10px;
  }
  /* Bayroq o'sha-o'sha - kichraytirilmaydi */
  #scr-online-setup .rule-card .rule-flag { width: 40px; height: 40px; flex: 0 0 40px; }
  #scr-online-setup .rule-text { flex: 1 1 auto; min-width: 0; padding-right: 26px; }
  #scr-online-setup .rule-name { font-size: 13.5px; }
  /* Muhr endi o'ng chekkada, o'rtada - past kartada burchakda siqilmasin */
  #scr-online-setup .rule-badge {
    top: 50%; right: 8px; transform: translateY(-50%);
    width: 21px; height: 21px; font-size: 11px;
  }
}

/* ---- 4) O'yinchilar jadvali ---- */
.ob-panel-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 12px 13px 10px; margin: 0 4px;
  border-bottom: 1px solid rgba(120, 90, 45, 0.35);
}
.ob-panel-title { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; min-width: 0; }
.ob-panel-title b {
  font-family: Georgia, "Times New Roman", "Noto Serif", serif;
  font-size: 16px; font-weight: 700; color: #3B2A12;
}
.ob-panel-title small { font-family: Georgia, "Times New Roman", serif; font-size: 11.5px; color: #7A5F32; }
.ob-panel-title small b { font-size: 11.5px; color: #6B4E23; }

.ob-filters { margin-left: auto; display: inline-flex; gap: 8px; flex-wrap: wrap; }
.ob-filter {
  position: relative; overflow: visible;
  padding: 9px 20px; min-width: 104px; text-align: center; border-radius: 7px; cursor: pointer;
  font-family: Georgia, "Times New Roman", serif; font-size: 14px; font-weight: 700;
  background: rgba(255, 255, 255, 0.3); color: #7A5F32;
  border: 1px solid rgba(120, 90, 45, 0.4);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

/* "Играют" tugmasidagi stollar soni - burchakda qizil muhr */
.ob-filter-badge {
  position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px;
  padding: 0 5px; border-radius: 10px;
  display: none; align-items: center; justify-content: center;
  font-family: Georgia, "Times New Roman", serif; font-size: 11.5px; font-weight: 700;
  background: linear-gradient(180deg, #C4443A, #8C2F28);
  color: #FFF0EC; border: 1px solid #6E241E; line-height: 1;
  box-shadow: 0 1px 4px rgba(90, 30, 25, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.ob-filter-badge.show { display: inline-flex; }
.ob-filter:hover { background: rgba(255, 255, 255, 0.55); color: #5A4526; }
.ob-filter.active {
  background: linear-gradient(180deg, #F6E4B4, #E3C87F);
  color: #33220A; border-color: #B8862B;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Ustun sarlavhalari */
/* Chekinishlar qator bilan AYNAN mos bo'lishi uchun: ro'yxat 11px +
   qator hoshiyasi 1px + qator chekinishi 11px = 23px;
   bu yerda 11px margin + 12px padding = 23px. */
.ob-table-head {
  display: grid; grid-template-columns: 1fr 92px 104px 116px; align-items: center;
  gap: 10px; padding: 8px 12px 6px; margin: 0 11px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.12em; color: #9C7B45;
  border-bottom: 1px solid rgba(120, 90, 45, 0.22);
}
.ob-table-head .obh-rating, .ob-table-head .obh-status { text-align: left; }

/* Qatorlar endi jadval ustunlariga tushadi */
.lobby-item {
  display: grid; grid-template-columns: 1fr 92px 104px 116px; align-items: center; gap: 10px;
}
.lobby-item.busy { opacity: 0.92; }
.lobby-status.is-free { color: #2E7D4F; font-weight: 700; }
.lobby-status.is-busy { color: #8C2F28; font-weight: 700; }
.lobby-status.is-search { color: #9A6B12; font-weight: 700; }

/* ---- "Играют": bitta qatorda IKKALA o'yinchi (bitta stol) ---- */
.lobby-table-item {
  border-color: rgba(140, 47, 40, 0.38);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.1));
}
/* "Играют" qatori: (avatar) ism  VS  ism (avatar) - avatarlar
   ikki CHEKKADA, o'yinchilar bir-biriga qarama-qarshi turgandek. */
/* Hammasi CHAP tomonga yig'iladi: (avatar) ism VS ism (avatar).
   Ilgari ismlar blokiga `flex: 1` berilgani uchun u butun bo'sh joyni
   egallar, ismlar o'rtada qolib, o'ng avatar chekkaga uchib ketardi. */
.lobby-table-info { cursor: default; gap: 10px; align-items: center; justify-content: flex-start; }
.lobby-table-avatar { flex-shrink: 0; }
.lobby-table-avatar .lobby-avatar { width: 34px; height: 34px; font-size: 12px; }
.lobby-table-avatar .lobby-avatar-dot { width: 8px; height: 8px; }

.lobby-table-pair {
  display: flex; align-items: center; justify-content: flex-start;
  gap: 8px; min-width: 0; flex: 0 1 auto; overflow: hidden;
}
.lobby-table-player {
  font-family: Georgia, "Times New Roman", "Noto Serif", serif;
  font-size: 14px; font-weight: 700; color: #3B2A12; letter-spacing: 0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  /* Foizli chegara endi yaramaydi: ota-blok kengligi mazmunga qarab
     o'zgaradi. Aniq px - bitta uzun ism ikkinchisini siqib chiqarmaydi. */
  max-width: 190px; min-width: 0;
  cursor: pointer; text-shadow: none;
}
.lobby-table-vs { font-size: 12px; flex-shrink: 0; opacity: 0.85; }

/* "Играют" ko'rinishida atigi 2 ta ustun qoladi: STOL va tugma.
   Reyting va "Ход" ustunlari umuman ko'rsatilmaydi. */
.ob-table-head.is-tables,
.lobby-list.is-tables .lobby-item { grid-template-columns: 1fr 128px; }
.ob-table-head.is-tables .obh-rating,
.ob-table-head.is-tables .obh-status { display: none; }
.lobby-rating { justify-content: flex-start; }
.lobby-item .lobby-challenge-btn, .lobby-item .live-game-watch { width: 100%; min-width: 0; justify-self: stretch; }

/* ---- Ikki ustunli joylashuv (chap: kartalar+qoidalar, o'ng: lobbi) ---- */
.ob-layout { display: block; }
.ob-col-left, .ob-col-right { min-width: 0; }

/* Izohning ikki varianti: tor ekranda 'ниже', keng ekranda 'справа' -
   lobbi kartasi 1060px dan boshlab o'ng ustunga chiqadi. */
.hint-right { display: none; }

@media (min-width: 1060px) {
  #scr-online-setup .wrap { max-width: 1160px; }
  .hint-below { display: none; }
  .hint-right { display: inline; }
  /* Ikkala taraf teng: chap yarim — kartalar+qoidalar, o'ng yarim — lobbi */
  .ob-layout {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px; align-items: stretch;
  }
  .ob-hero { margin-bottom: 18px; }
  /* Lobbi kartasi yuqoridan "С другом" bilan bir sathda boshlanadi va
     pastdagi qoida kartalarining oxirigacha cho'ziladi */
  .ob-col-right { display: flex; flex-direction: column; }
  .ob-col-right .premium-lobby-card {
    margin-top: 0; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 260px;
  }
  .ob-col-right .lobby-list { flex: 1 1 auto; min-height: 0; max-height: none; }
  .rules-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  /* Qoida kartalari: o'lchami o'sha-o'sha, ichida faqat bayroq va nom */
  .ob-col-left .rule-card {
    padding: 9px 10px 10px; gap: 8px;
    height: 103px; justify-content: center;
  }
  .ob-col-left .rule-card .rule-meta,
  .ob-col-left .rule-card .rule-desc { display: none; }
  .ob-col-left .rule-card .rule-flag { width: 54px; height: 54px; flex-basis: 54px; }
  .ob-col-left .rule-card .rule-text { flex: 0 0 auto; }
  .ob-col-left .rule-name { font-size: 16px; }
  .ob-col-left .rule-badge { top: 9px; right: 9px; width: 22px; height: 22px; font-size: 11px; }
}

/* Raqib qidirilayotganda faqat radar qoladi */
#scr-online-setup.is-searching .ob-section-head,
#scr-online-setup.is-searching .rules-grid,
#scr-online-setup.is-searching .premium-lobby-card { display: none; }
#scr-online-setup.is-searching .ob-layout { display: block; }

@media (max-width: 900px) {
  .ob-hero { grid-template-columns: 1fr; }
  .rules-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .ob-statusbar { gap: 6px 12px; padding: 8px 10px; }
  .ob-idbox { margin-left: 0; width: 100%; justify-content: space-between; }
  /* Kichik ekranda ID sarlavha ostidagi qatorga o'ngga tushadi */
  #scr-online-setup .screen-head { flex-wrap: wrap; }
  #scr-online-setup .screen-head h2 { flex: 1 1 auto; }
  .screen-head .ob-idbox { width: 100%; margin-left: 0; justify-content: flex-end; gap: 6px; font-size: 11px; }
  .screen-head .ob-idbox b { font-size: 12px; }
  .screen-head .ob-copy { padding: 3px 8px; font-size: 10px; }
  .ob-title { font-size: 18px; }
  .ob-card { padding: 13px 14px; }
  .ob-btn-main { width: 100%; text-align: center; }
  .ob-section-head h3 { font-size: 15.5px; }
  .ob-section-head small { display: none; }
  .ob-filters { margin-left: 0; width: 100%; }
  .ob-filter { flex: 1; padding: 6px 4px; font-size: 11px; text-align: center; }
  .ob-table-head { grid-template-columns: 1fr 66px 92px; }
  .ob-table-head .obh-act { display: none; }
  .lobby-item { grid-template-columns: 1fr 66px 92px; grid-template-areas: "info rating status" "btn btn btn"; row-gap: 8px; }
  .lobby-item .lobby-item-info { grid-area: info; }
  .lobby-item .lobby-challenge-btn, .lobby-item .live-game-watch { grid-area: btn; }
  .lobby-table-player { font-size: 12.5px; max-width: 110px; }
  .lobby-table-avatar .lobby-avatar { width: 28px; height: 28px; font-size: 10.5px; }
  /* Tor ekranda ham "Играют" qatori 2 ustunda qoladi (reyting/ход yo'q) */
  .ob-table-head.is-tables,
  .lobby-list.is-tables .lobby-item {
    grid-template-columns: 1fr; grid-template-areas: "info" "btn"; row-gap: 8px;
  }
  .lobby-list.is-tables .lobby-item .lobby-item-info { grid-area: info; }
  .lobby-list.is-tables .lobby-item .live-game-watch { grid-area: btn; }
  .ob-filter { min-width: 0; padding: 8px 6px; font-size: 12.5px; }
  .rule-desc { display: none; }
}

/* Juda tor telefonlarda ism ustuni siqilib qolmasin */
@media (max-width: 420px) {
  .ob-table-head, .lobby-item { grid-template-columns: 1fr 56px 74px; gap: 6px; }
  .ob-table-head { padding: 8px 9px 6px; margin: 0 9px; }
}

/* ================= ONLAYN EKRAN — ILOVA USLUBI =================
   Ilovaning umumiy tili: to'q ko'k-qora shisha panel + guruch hoshiya
   (menyu tugmalari va reyting jadvalidagi kabi). Faqat "Быстрая игра"
   kartasi iliq yog'och bo'lib qoladi — u asosiy urg'u. */

/* ---- "С другом по ID" — sovuq shisha panel ---- */
#scr-online-setup .ob-card-side {
  background: linear-gradient(150deg, #2B3B55, #0E1929);
  border: 1px solid rgba(226, 169, 59, 0.34); border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 8px 18px rgba(0, 0, 0, 0.42);
}
#scr-online-setup .ob-card-side::after { border-color: rgba(255, 255, 255, 0.06); }
#scr-online-setup .ob-card-side .ob-kicker { color: rgba(255, 242, 212, 0.5); }
#scr-online-setup .ob-card-side .ob-title { color: #FFF4D5; text-shadow: 0 2px 3px rgba(0, 0, 0, 0.7); }
#scr-online-setup .ob-card-side .ob-desc { color: rgba(255, 242, 212, 0.62); }
#scr-online-setup .ob-btn-ghost {
  background: rgba(226, 169, 59, 0.15); color: #FFE18B; border-radius: 10px;
  border: 1px solid rgba(255, 224, 123, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
#scr-online-setup .ob-btn-ghost:hover {
  background: rgba(226, 169, 59, 0.26); border-color: rgba(255, 215, 116, 0.7); color: #FFF0BE;
}

/* Asosiy karta ham shu oilaga: iliq yog'och, lekin guruch hoshiya bilan */
#scr-online-setup .ob-card-main { border-radius: 14px; }
#scr-online-setup .ob-card-main::after { border-color: rgba(255, 224, 123, 0.14); }

/* ---- Qoida kartalari ---- */
#scr-online-setup .rule-card {
  /* To'liq qorong'i (shaffof emas) — orqadagi yog'och ko'rinmaydi */
  background: linear-gradient(150deg, #24344E, #0D1727);
  border: 1px solid rgba(226, 169, 59, 0.22); border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 6px 14px rgba(0, 0, 0, 0.35);
}
#scr-online-setup .rule-card::after { border-color: transparent; }
/* Matnlar olib tashlangani uchun bayroq+nom kartada markazda tursin */
#scr-online-setup .rule-card { justify-content: center; }
#scr-online-setup .rule-card:hover {
  border-color: rgba(255, 215, 116, 0.5);
  background: linear-gradient(150deg, #2E4162, #111E33);
}
#scr-online-setup .rule-name { color: rgba(255, 244, 213, 0.9); }
#scr-online-setup .rule-meta { color: rgba(255, 242, 212, 0.5); }
/* Bayroq: atrofidagi dumaloq hoshiya yo'q */
#scr-online-setup .rule-card .rule-flag {
  border: none; background: none; filter: saturate(1);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
}
/* Zaldagi onlayn o'yinchilar soni — yashil */
#scr-online-setup .rule-badge {
  /* Faqat yashil raqamning o'zi: hech qanday fon, hoshiya yoki shisha effekt yo'q */
  width: auto; height: auto; min-width: 0; padding: 0;
  background: none; border: none; box-shadow: none;
  font-size: 19px; font-weight: 800; line-height: 1;
  color: rgba(126, 255, 190, 0.55);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}
#scr-online-setup .rule-badge.has-players {
  color: #7CFFC0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7), 0 0 10px rgba(60, 255, 150, 0.45);
}
/* Tanlangan qoida — reyting jadvalidagi "birinchi o'rin" kabi oltin urg'u */
#scr-online-setup .rule-card.active {
  background: linear-gradient(150deg, #97701F, #4A2C0A);
  border-color: #FFD978;
  box-shadow: 0 0 18px rgba(255, 215, 80, 0.2), inset 0 1px 0 rgba(255, 246, 190, 0.28);
}
#scr-online-setup .rule-card.active .rule-name { color: #FFF0BE; text-shadow: 0 2px 3px rgba(0, 0, 0, 0.6); }
#scr-online-setup .rule-card.active .rule-flag { box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5); }
/* Tanlangan kartada ham son yashil bo'lib qoladi (oltin fonda o'qilsin) */
/* Oltin (tanlangan) kartada ham faqat raqam — o'qilishi uchun to'qroq soya */
#scr-online-setup .rule-card.active .rule-badge {
  background: none; border: none; box-shadow: none;
  color: rgba(190, 255, 220, 0.7);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}
#scr-online-setup .rule-card.active .rule-badge.has-players {
  color: #9CFFD0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9), 0 0 10px rgba(60, 255, 150, 0.5);
}

.premium-wrapper { position: relative; width: 100%; }
.premium-btn {
  display: flex; align-items: center; width: 100%; padding: 0;
  background: linear-gradient(180deg, #FCEABB, #D9A832); border: none; border-radius: 20px;
  color: #1C0F00; cursor: pointer; position: relative;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.15s; overflow: visible; height: 75px;
}
.premium-btn:active { transform: scale(0.98); }
.premium-btn-icon { width: 60px; flex-shrink: 0; display: grid; place-items: center; font-size: 28px; border-right: 1.5px solid rgba(0,0,0,0.08); height: 60%; margin-left: 5px; }
.premium-btn-title { flex: 1; min-width: 0; padding: 0 15px; font-weight: 900; font-size: 15px; letter-spacing: 0.5px; text-align: left; text-transform: uppercase; }

.premium-btn-rule-trigger {
  width: 155px; flex-shrink: 0; height: 65px; background: rgba(0,0,0,0.92); color: #fff;
  display: flex; align-items: center; padding: 0 10px; gap: 8px; border-radius: 18px; margin-right: 6px;
  box-shadow: inset 0 0 10px rgba(255,255,255,0.05);
}
.rule-trigger-icon {
  width: 24px; height: 24px; border-radius: 50%; object-fit: contain;
  box-shadow: 0 2px 5px rgba(0,0,0,0.5); flex-shrink: 0;
}
.rule-trigger-content { flex: 1; display: flex; flex-direction: column; text-align: left; overflow: hidden; min-width: 0; }
.rule-trigger-content small { font-size: 8.5px; font-weight: 800; opacity: 0.7; text-transform: uppercase; white-space: nowrap; margin-bottom: 2px; }
.rule-trigger-content b { font-size: 11px; font-weight: 900; color: #FFD56A; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rule-trigger-arrow { font-size: 10px; opacity: 0.8; color: #FFD56A; flex-shrink: 0; }

.premium-dropdown {
  position: absolute; top: 82px; right: 6px; width: 160px; background: #1C0F00;
  border: 1.5px solid #D9A832; border-radius: 16px; z-index: 100;
  display: flex; flex-direction: column; gap: 2px; padding: 6px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.9);
  opacity: 0; transform: translateY(-10px) scale(0.95); pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: top right;
}
.premium-dropdown.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  cursor: pointer; transition: background 0.2s;
}
.dropdown-item:hover { background: rgba(255,255,255,0.08); }
.dropdown-item.active { background: rgba(226, 169, 59, 0.2); border: 1px solid rgba(226, 169, 59, 0.4); }
.dropdown-item img { width: 24px; height: 24px; border-radius: 50%; object-fit: contain; box-shadow: 0 2px 5px rgba(0,0,0,0.5); flex-shrink: 0; }
.dropdown-item span { font-size: 11px; font-weight: 900; color: #FFF2D4; text-transform: uppercase; }

.match-found-card {
  max-width: 400px; width: 92%;
  background: linear-gradient(145deg, #172237 0%, #0b1423 100%);
  border: 2px solid #E2A93B; border-radius: 20px;
  padding: 18px; text-align: center;
  box-shadow: 0 10px 35px rgba(0,0,0,0.85), inset 0 1px 0 rgba(255,225,147,0.2);
}
.match-found-header {
  display: flex; align-items: center; justify-content: space-between;
  color: #FFD56A; font-weight: 900; font-size: 15px; letter-spacing: 1px; margin-bottom: 15px;
}
.vs-container {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 15px 0 20px 0;
}
.vs-player {
  display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; min-width: 0;
}
.vs-avatar {
  width: 58px; height: 58px; border-radius: 50%;
  background: linear-gradient(135deg, #241A10, #1C130C);
  border: 2px solid #FFD56A; display: flex; align-items: center; justify-content: center;
  font-size: 26px; box-shadow: 0 4px 10px rgba(0,0,0,0.6); color: #FFD700;
}
.vs-name {
  font-size: 13px; font-weight: 800; color: #FFF2D4;
  max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vs-elo {
  font-size: 10.5px; font-weight: 800; color: #FFD56A;
  background: rgba(217,168,50,0.16); border: 1px solid rgba(252,234,187,0.25);
  border-radius: 6px; padding: 2px 7px; white-space: nowrap;
}
.vs-badge {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  border: 2px solid #FFD56A; display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 15px; color: #fff;
  box-shadow: 0 0 15px rgba(231,76,60,0.6); flex-shrink: 0;
  animation: pulse-vs 1.2s infinite alternate;
}
@keyframes pulse-vs {
  0% { transform: scale(1); box-shadow: 0 0 8px rgba(231,76,60,0.5); }
  100% { transform: scale(1.12); box-shadow: 0 0 20px rgba(231,76,60,0.9); }
}
.vs-countdown {
  font-size: 13.5px; color: #FFF2D4; font-weight: 700; margin-bottom: 12px;
}
.vs-countdown b {
  font-size: 20px; color: #FFD56A; margin: 0 4px;
}

/* Replay view uses the dedicated replay controls only. Hide regular in-game actions. */
body.replay-mode .actionbar { display: none !important; }

/* Final desktop menu fit: deterministic CSS fallback for embedded/platform windows.
   This does not depend on JavaScript timing or visualViewport and prevents the
   menu from being clipped before/while the page is initializing. */
@media (min-width: 521px) {
  #scr-menu.active .menu-bg-wrap {
    justify-content: center !important;
    overflow: hidden !important;
    padding: 0 16px !important;
  }
  #scr-menu.active .menu-center {
    transform-origin: center center !important;
    flex: 0 0 auto !important;
  }
}
/* BUG FIX: menyu to'liq ekranda kattalashmasdi.
   Sababi shu bosqichlarda edi: eng katta qiymat `scale(1)` bo'lgani va
   `!important` JS hisobini butunlay bekor qilgani uchun menyu O'Z tabiiy
   o'lchamidan KATTA bo'la olmasdi. Oyna 940px dan 1080px ga o'sganda
   masshtab atigi 0.98 -> 1.00 ga o'zgarardi, ya'ni ~2% - ko'z ilg'amasdi.
   Endi baland ekranlarda menyu bo'sh joyni to'ldiradi.
   Kenglik sharti (min-width) qo'shildi: tor, lekin baland oynada menyu
   yon tomonlarga chiqib ketmasligi uchun. */
@media (min-width: 521px) and (max-height: 800px) {
  #scr-menu.active .menu-center { transform: scale(var(--menu-scale, 0.88)) !important; }
}
@media (min-width: 521px) and (min-height: 801px) and (max-height: 900px) {
  #scr-menu.active .menu-center { transform: scale(var(--menu-scale, 0.94)) !important; }
}
@media (min-width: 521px) and (min-height: 901px) {
  #scr-menu.active .menu-center { transform: scale(var(--menu-scale, 1)) !important; }
}

/* ==================================================================
   ONLAYN CHAT - Telegram uslubidagi yozishmalar oynasi
   ================================================================== */
#modal-chat { padding: 0; align-items: flex-end; justify-content: center; }
@media (min-width: 560px) { #modal-chat { padding: 20px; align-items: center; } }

.chat-card {
  display: flex; flex-direction: column;
  width: 100%; max-width: 440px;
  height: min(78vh, 640px);
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  border: 1px solid var(--line);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -12px 50px rgba(0,0,0,.7);
  overflow: hidden;
  animation: chatRise .24s cubic-bezier(.2,.9,.3,1) both;
  padding-bottom: var(--safe-b);
}
@media (min-width: 560px) { .chat-card { border-radius: 20px; height: min(72vh, 600px); } }
@keyframes chatRise { from { transform: translateY(26px); opacity: 0 } to { transform: none; opacity: 1 } }

.chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; flex: 0 0 auto;
  background: linear-gradient(180deg, rgba(226,169,59,.16), rgba(226,169,59,.05));
  border-bottom: 1px solid var(--line);
}
.chat-peer { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.chat-avatar {
  width: 38px; height: 38px; flex: 0 0 auto; border-radius: 50%;
  display: grid; place-items: center; font-size: 17px; font-weight: 900;
  color: #FFDB76; background: linear-gradient(145deg, #355071, #172538);
  border: 1.5px solid rgba(255,248,219,.45);
}
.chat-peer-txt { display: flex; flex-direction: column; min-width: 0; }
.chat-peer-txt b {
  font-size: 15px; color: var(--cream); font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-peer-txt small { font-size: 11px; color: var(--turq); font-weight: 700; }
.chat-close {
  width: 32px; height: 32px; flex: 0 0 auto; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: rgba(255,255,255,.07); border: none; color: var(--brass-hi);
}
.chat-close:active { transform: scale(.93); }

.chat-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 12px 12px 6px;
  display: flex; flex-direction: column; gap: 7px;
}
.chat-body::-webkit-scrollbar { width: 5px; }
.chat-body::-webkit-scrollbar-thumb { background: rgba(226,169,59,.3); border-radius: 4px; }

.chat-empty {
  margin: auto; text-align: center; color: var(--muted);
  font-size: 13px; line-height: 1.6; padding: 20px;
}
.chat-empty span { display: block; font-size: 30px; margin-bottom: 8px; opacity: .5; }

.chat-msg { display: flex; max-width: 100%; }
.chat-msg.me { justify-content: flex-end; }
.chat-msg.them { justify-content: flex-start; }

.chat-bubble {
  position: relative;
  max-width: 78%;
  padding: 7px 11px 5px;
  border-radius: 14px;
  font-size: 14.5px; line-height: 1.35;
  word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap;
  box-shadow: 0 1px 2px rgba(0,0,0,.35);
  animation: chatPop .16s ease both;
}
@keyframes chatPop { from { transform: translateY(4px); opacity: 0 } to { transform: none; opacity: 1 } }
.chat-msg.me .chat-bubble {
  background: linear-gradient(160deg, #8a5f16, #6b4711);
  color: #FFF6DE; border-bottom-right-radius: 5px;
}
.chat-msg.them .chat-bubble {
  background: var(--ink-3); color: var(--cream);
  border: 1px solid rgba(255,255,255,.06); border-bottom-left-radius: 5px;
}
.chat-time {
  display: block; text-align: right; margin-top: 2px;
  font-size: 10px; font-weight: 700; opacity: .62; letter-spacing: .02em;
}

.chat-presets {
  flex: 0 0 auto; display: flex; gap: 6px;
  padding: 8px 10px; overflow-x: auto; overscroll-behavior-x: contain;
  border-top: 1px solid rgba(226,169,59,.12);
  scrollbar-width: none;
}
.chat-presets::-webkit-scrollbar { display: none; }
.chat-chip {
  flex: 0 0 auto; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  font-size: 13px; font-weight: 700; white-space: nowrap;
  color: var(--brass-hi); background: rgba(226,169,59,.12);
  border: 1px solid rgba(226,169,59,.28);
}
.chat-chip:active { transform: scale(.95); background: rgba(226,169,59,.22); }

.chat-inputrow {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  padding: 9px 10px 11px; border-top: 1px solid var(--line);
  background: rgba(10,21,35,.6);
}
.chat-inputrow input {
  flex: 1; min-width: 0; padding: 10px 14px;
  border-radius: 999px; border: 1px solid rgba(226,169,59,.28);
  background: rgba(10,21,35,.92); color: #fff;
  font-size: 15px; font-family: var(--font); outline: none;
}
.chat-inputrow input::placeholder { color: rgba(141,162,190,.75); }
.chat-inputrow input:focus { border-color: rgba(255,213,106,.6); }
.chat-send {
  width: 42px; height: 42px; flex: 0 0 auto; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; border: none;
  color: #21160a; background: linear-gradient(160deg, #FFDD8A, #D99A2B);
  box-shadow: 0 3px 10px rgba(226,169,59,.32);
}
.chat-send:active { transform: scale(.92); }
.chat-send:disabled { opacity: .4; cursor: default; box-shadow: none; }

/* O'qilmagan xabar belgisi - amallar panelidagi "Чат" tugmasida */
.act { position: relative; }
.chat-badge {
  position: absolute; top: 2px; right: 6px; min-width: 17px; height: 17px;
  padding: 0 4px; border-radius: 999px;
  display: none; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 900; line-height: 1;
  color: #fff; background: #D8564B; border: 1.5px solid var(--ink);
  box-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.chat-badge.show { display: flex; animation: chatPop .2s ease both; }

/* Maxfiylik siyosati / foydalanuvchi shartnomasi havolalari (sozlamalar ekrani).
   Google Search Console va ilova do'konlari uchun bu sahifalar SHART. */
.legal-links {
  margin: 18px 0 4px;
  text-align: center;
  font-size: 13px;
  color: var(--muted, #9fb3ca);
  opacity: .85;
}
.legal-links a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.legal-links a:hover { color: #e9b949; }
.legal-links span { margin: 0 8px; }


/* ==========================================================
   "SIZ JADVALDA YO'QSIZ" PANELI
   Ekranning PASTIGA YOPISHADI (position: sticky) - ro'yxat
   qanchalik uzun bo'lsa ham yangi o'yinchi uni ko'radi.
   Ilgari bu ro'yxatning eng oxirida turgan katta karta edi:
   o'yinchi uni topish uchun 50 ta qatorni aylantirishi kerak edi.

   MUHIM: panel #lb-body ICHIDA emas, `.wrap` ichida turadi -
   #lb-body da `overflow-x:hidden` bor va u sticky ni o'ldiradi.
   ========================================================== */
/* Pastki to'ldirma panelning O'ZIDA - shunda panel ekranning eng
   pastigacha yetadi, ostida yog'och rangli tirqish qolmaydi. */
#scr-leaders { padding-bottom: 0; }
#scr-leaders > .wrap {
  flex: 1 0 auto;
  display: flex; flex-direction: column;
}
/* `width:100%` SHART. `.wrap` flex-ustunga aylangani uchun `#lb-body` dagi
   `margin: 0 auto` (ko'ndalang o'qdagi `auto`) `stretch` ni O'CHIRADI va
   jadval mazmuniga qarab qisqarib qoladi (560px o'rniga 255px). */
#scr-leaders > .wrap > #lb-body { flex: 0 0 auto; width: 100%; }

.lb-me-bar {
  position: sticky; bottom: 0; z-index: 6;
  display: flex; align-items: center; gap: 10px;
  /* margin-top:auto - ro'yxat kalta bo'lsa panel baribir PASTDA turadi */
  margin: auto -16px 0;
  padding: 9px 16px calc(11px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(226, 169, 59, .38);
  background: rgba(9, 18, 30, .93);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 -8px 20px rgba(0, 0, 0, .38);
}
.lb-me-av {
  flex: 0 0 auto;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 900; color: #2A1B06;
  background: linear-gradient(180deg, #FFDD8A, #E2A93B 58%, #9C6C18);
}
.lb-me-who { flex: 1; min-width: 0; }
.lb-me-line { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.lb-me-line b {
  font-size: 13.5px; font-weight: 800; color: #FFF2D4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lb-me-line i {
  flex: 0 0 auto;
  font-style: normal; font-size: 14px; font-weight: 900; color: #FFD978;
}
.lb-me-who span {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  margin-top: 1px; overflow: hidden;
  font-size: 11px; line-height: 1.35; color: var(--muted);
}
.lb-me-cta {
  flex: 0 0 auto;
  padding: 8px 15px; border-radius: 10px;
  border: 1px solid rgba(226, 169, 59, .55);
  background: linear-gradient(180deg, rgba(255, 221, 138, .22), rgba(226, 169, 59, .16));
  color: #FFE6AE; font-family: inherit; font-size: 12.5px; font-weight: 800;
  letter-spacing: .02em; cursor: pointer;
}
.lb-me-cta:hover { background: linear-gradient(180deg, rgba(255, 221, 138, .32), rgba(226, 169, 59, .24)); }
.lb-me-cta:active { transform: translateY(1px); }
.lb-me-cta:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

@media (max-width: 360px) {
  .lb-me-av { display: none; }
  .lb-me-cta { padding: 8px 12px; font-size: 12px; }
}
