/* ПК-лобби: собственная композиция, общие игровые действия. */
html.web-boot, body.web-client {
  --web-viewport-u: min(.052083333vw, .092592593dvh);
}
body.web-client {
  --web-u: var(--web-viewport-u);
  /* Обе темы: текст/нижний конец подложки бот 9.03, друзья 8.48, поиск 7.70. */
  --web-ink: #491602;
  --web-muted: #603325;
  --web-cream: #fff0d8;
  --web-edge: #fff8e9;
  --web-shadow: #64290c70;
  --web-rim: #bb733d;
  max-width: 1040px;
  padding: 0 24px;
}
.web-link { border: 0; background: transparent; color: inherit; font: inherit;
  text-underline-offset: 5px; text-decoration: underline; cursor: pointer; padding: 10px 0; }
.web-toolbar { position: fixed; z-index: 15; right: max(24px, 3vw); top: 20px;
  display: flex; align-items: center; color: var(--web-ink);
  font: 600 16px/1.3 "Lobby Rubik", sans-serif; }
.web-toolbar .web-link { border: 1px solid #c99658; border-radius: 30px;
  padding: 11px 20px; min-height: 44px; background: #fff0d8ed; max-width: 240px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  box-shadow: 0 3px 10px #54250426; text-decoration: none; }
.playing .web-toolbar { display: none; }
/* Та же сцена и место логотипа до загрузки клиентских обработчиков. */
#splash .web-loading { display: none; }
html.web-boot #splash {
  --web-u: var(--web-viewport-u);
  background: #e87818 url("../assets/web/lobby-carpet-2026-10-29-q82.webp") center / cover no-repeat;
}
html.web-boot #splash::before, html.web-boot #splash::after { content: none; }
html.web-boot #splash .badge {
  position: absolute; top: calc(28 * var(--web-u)); left: 50%; transform: translateX(-50%);
  width: calc(420 * var(--web-u)); height: calc(150 * var(--web-u)); padding: 0; gap: 0;
}
html.web-boot #splash .logo {
  width: 100%; height: 100%; border-radius: 0; box-shadow: none; animation: none;
  background: url("../assets/web/brand-sign-2026-10-31-q88.webp") center / contain no-repeat;
  filter: drop-shadow(0 calc(5 * var(--web-u)) calc(4 * var(--web-u)) #692b1555);
}
html.web-boot #splash .nm { display: none; }
html.web-boot #splash .web-loading {
  display: block; position: absolute; top: calc(200 * var(--web-u)); left: 0; width: 100%;
  margin: 0; text-align: center; color: #491602;
  font: 600 max(14px, calc(22 * var(--web-u)))/1.4 system-ui, sans-serif;
}
@keyframes web-lobby-reveal { from { opacity: 0; } to { opacity: 1; } }
html.web-reveal body.web-client #lobby :is(.lc-title, .lc-cards, .lc-nav) {
  animation: web-lobby-reveal 360ms ease-out both;
}
@media (prefers-reduced-motion: reduce) {
  html.web-reveal body.web-client #lobby :is(.lc-title, .lc-cards, .lc-nav) { animation: none; }
}
.web-toolbar button:focus-visible, .web-leave:focus-visible,
.web-dialog :is(button, input):focus-visible {
  outline: 3px solid var(--web-ink); outline-offset: 5px; }
body.web-client #lobby.lc-screen {
  display: grid; place-items: center; overflow: auto;
  background: #e87818 url("../assets/web/lobby-carpet-2026-10-29-q82.webp") center / cover no-repeat;
}
body.web-client #lobby.lc-screen::before { content: none; }
body.web-client #lobby .lc-panel {
  display: grid; grid-template-rows: calc(150 * var(--web-u)) calc(110 * var(--web-u))
    calc(490 * var(--web-u)) calc(170 * var(--web-u)) calc(24 * var(--web-u));
  row-gap: calc(20 * var(--web-u)); align-content: center;
  width: calc(1680 * var(--web-u)); height: calc(1080 * var(--web-u)); min-height: 0;
  padding: calc(14 * var(--web-u)) 0; margin: 0 auto; background: none;
}
body.web-client #lobby .web-brand {
  position: relative; display: flex; align-items: center; justify-content: center;
  gap: calc(18 * var(--web-u)); justify-self: center; margin: 0;
  width: calc(420 * var(--web-u)); height: 100%; padding: 0;
  box-sizing: border-box; color: var(--web-ink);
  background: url("../assets/web/brand-sign-2026-10-31-q88.webp") center / contain no-repeat;
  filter: drop-shadow(0 calc(5 * var(--web-u)) calc(4 * var(--web-u)) #692b1555);
}
/* Название доступно для чтения с экрана; видимая надпись уже в логотипе. */
body.web-client #lobby .web-brand > span { position: absolute;
  width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body.web-client #lobby .lc-title { top: 0; margin: 0; width: calc(1050 * var(--web-u)); height: 100%;
  justify-self: center; align-self: center; max-width: 100%; }
body.web-client #lobby .lc-title::before { width: 125%; height: 160%; max-width: none; }
body.web-client #lobby .lc-title-curve { top: 50%; transform: translateY(-50%); }
body.web-client #lobby .lc-cards { top: 0; transform: none; display: grid;
  /* Карточки на 15% компактнее; остальная композиция сохраняет свой размер. */
  --web-u: calc(var(--web-viewport-u) * .85);
  width: 85%; height: 85%; place-self: center;
  grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr);
  gap: calc(24 * var(--web-u)); min-height: 0; max-height: none; }
body.web-client #lobby .lc-card {
  --web-card-top: #ffe6b2; --web-card-bottom: #edb071;
  --web-copy-top: #fff0d2; --web-copy-bottom: #f0c08d;
  top: 0; display: flex; align-items: center; justify-content: flex-start;
  box-sizing: border-box; aspect-ratio: auto; min-width: 0; min-height: 0;
  padding: calc(354 * var(--web-u)) calc(14 * var(--web-u)) 0;
  border: 0; border-radius: calc(66 * var(--web-u));
  background: none; text-align: center; overflow: visible; color: var(--web-ink);
  transition: translate 180ms ease, scale 150ms ease;
}
body.web-client #lobby .lc-card--friends { --web-card-top: #ffd7e6; --web-card-bottom: #e59aad;
  --web-copy-top: #ffe4dc; --web-copy-bottom: #f0b5a6; }
body.web-client #lobby .lc-card--search { --web-card-top: #edbaf3; --web-card-bottom: #b56fc7;
  --web-copy-top: #f9d8e7; --web-copy-bottom: #dfabc6; }
body.web-client #lobby .lc-card::before { inset: 0; z-index: -2;
  background: radial-gradient(ellipse at 35% 0, #fff5df80, transparent 65%),
    linear-gradient(150deg, var(--web-card-top), var(--web-card-bottom));
  border: 2px solid #fff1ddaa;
  box-shadow: inset 0 3px 4px #fff9eb, inset 0 -5px 7px #a45d2944,
    0 calc(7 * var(--web-u)) 0 #985021, 0 calc(18 * var(--web-u)) calc(24 * var(--web-u)) var(--web-shadow);
  filter: none;
}
body.web-client #lobby .lc-card::after { content: ""; position: absolute; z-index: -1;
  bottom: 0; left: calc(-2 * var(--web-u)); right: calc(-2 * var(--web-u)); height: calc(166 * var(--web-u));
  border-radius: calc(61 * var(--web-u)); border: 2px solid #fff2dfb8;
  background: linear-gradient(165deg, var(--web-copy-top), var(--web-copy-bottom));
  box-shadow: inset 0 2px 2px #fff8e8, inset 0 -4px 6px #ad672636, 0 -5px 15px #81401c18;
  pointer-events: none;
}
body.web-client #lobby .lc-artwork { z-index: -1; inset: calc(-32 * var(--web-u)) calc(20 * var(--web-u)) calc(150 * var(--web-u)); }
body.web-client #lobby .lc-artwork .lc-character { width: 100%; height: 100%; max-height: none;
  top: auto; bottom: 0; left: 0; object-fit: contain; object-position: center bottom; }
body.web-client #lobby .lc-card :is(.lc-card-title, .lc-card-hint, .lc-card-warning) {
  position: relative; left: 0; width: 100%; white-space: normal; color: var(--web-ink); }
body.web-client #lobby .lc-card-title { font: 750 max(18px, calc(41 * var(--web-u)))/1.1 var(--m-font);
  letter-spacing: -.04em; min-height: 0; text-wrap: nowrap; }
body.web-client #lobby .lc-card-hint { font: 600 max(12px, calc(25 * var(--web-u)))/1.25 var(--m-font);
  margin-top: calc(13 * var(--web-u)); min-height: 0; letter-spacing: -.025em; }
body.web-client #lobby .lc-card-warning { font: 500 max(12px, calc(23 * var(--web-u)))/1.2 var(--m-font);
  margin-top: calc(4 * var(--web-u)); letter-spacing: -.025em; }
body.web-client #lobby .lc-nav { top: 0; width: calc(910 * var(--web-u)); height: 100%;
  margin: 0 auto; gap: calc(24 * var(--web-u)); align-self: center; align-items: stretch; }
body.web-client #lobby .lc-nav-button { position: relative; width: 100%; height: 100%; aspect-ratio: auto;
  min-height: 44px; padding: 0; overflow: hidden; border: 2px solid #fff5e2;
  border-radius: calc(43 * var(--web-u)); background: linear-gradient(165deg, #fff0d2, #f0c08d);
  box-shadow: 0 calc(5 * var(--web-u)) 0 var(--web-rim), 0 calc(12 * var(--web-u)) calc(15 * var(--web-u)) var(--web-shadow);
  transition: translate 180ms ease, scale 150ms ease;
}
body.web-client #lobby .lc-nav-button::before { inset: -2px; filter: none;
  background-size: 59.2% auto; background-position: center top;
  /* Сохраняем исходную иллюстрацию, плавно соединяя её подложку с широкой кнопкой. */
  mask-image: linear-gradient(90deg, transparent 20%, #000 32% 68%, transparent 80%),
    linear-gradient(#000 65%, transparent 95%);
  mask-composite: intersect; }
body.web-client #lobby .lc-nav-button > svg { display: none; }
body.web-client #lobby .lc-nav-button > span { position: absolute; bottom: calc(16 * var(--web-u));
  left: 0; width: 100%; transform: none; color: var(--web-ink);
  font: 650 max(14px, calc(29 * var(--web-u)))/1.15 var(--m-font); }
body.web-client #lobby .lc-info { position: static; margin: 0; min-height: 0;
  color: var(--web-ink); font-size: max(12px, calc(16 * var(--web-u))); }
/* Пустая строка остаётся для ошибок и статуса, без рекламной подписи. */
body.web-client #lobby .lc-info:not(.is-alert) { visibility: hidden; }
body.web-client #lobby :is(.lc-card, .lc-nav-button):focus-visible { outline: 3px solid var(--web-ink); outline-offset: 7px; }
@media (hover: hover) {
  body.web-client #lobby :is(.lc-card, .lc-nav-button):not(:disabled):hover { translate: 0 calc(-5 * var(--web-u)); }
  body.web-client #lobby .lc-card:not(:disabled):hover::before { filter: brightness(1.025); }
}
body.web-client #lobby .lc-card:not(:disabled):is(:active, .is-pressed)::before { filter: brightness(.98); }
body.web-client #lobby .lc-card.is-pressed, body.web-client #lobby .lc-nav-button.is-pressed { scale: .98; translate: 0 1px; }
body.web-client #gameViewport { width: 100%; }
.web-leave { display: none; position: fixed; left: 24px; top: 20px; z-index: 20;
  border: 1px solid #b99573; background: #fff4df; color: #3b271c; border-radius: 12px;
  padding: 12px 20px; font: 600 16px/1.3 system-ui; cursor: pointer; }
.playing .web-leave { display: block; }
@media (max-width: 1000px), (max-height: 650px) {
  .web-toolbar { top: 10px; right: 12px; font-size: 13px; }
  .web-toolbar .web-link { padding: 8px 13px; }
  body.web-client #lobby .lc-card { padding-top: calc(330 * var(--web-u)); padding-bottom: 6px; }
  body.web-client #lobby .lc-card-title { white-space: normal; text-wrap: balance; }
}
@media (prefers-reduced-motion: reduce) {
  body.web-client #lobby :is(.lc-card, .lc-nav-button),
  body.web-client #lobby :is(.lc-card, .lc-nav-button).is-pressed { transition: none; translate: none; scale: 1; }
  body.web-client #lobby .lc-card::before { transition: none; }
}

.web-dialog { visibility: visible; width: min(440px, calc(100vw - 64px)); box-sizing: border-box;
  padding: 36px; border: 1px solid #c79b6a; border-radius: 24px; background: #fff4df;
  color: #3b271c; box-shadow: 0 24px 80px #25130780; font: 17px/1.5 system-ui, sans-serif; }
.web-dialog::backdrop { background: #25130799; }
.web-dialog h2 { font-size: 28px; line-height: 1.2; margin: 0 24px 20px 0; }
.web-dialog label { display: block; font-weight: 600; }
.web-dialog input { display: block; box-sizing: border-box; width: 100%; margin-top: 8px;
  padding: 12px; font: inherit; border: 1px solid #947253; border-radius: 10px; background: #fffdf7; color: #3b271c; }
.web-dialog button:focus-visible { outline-color: #66351c; }
.web-close { position: absolute; right: 12px; top: 8px; width: 44px; height: 44px;
  border: 0; background: transparent; font: 30px/1 system-ui; color: inherit; cursor: pointer; }
.web-action { width: 100%; padding: 14px 20px; border: 0; border-radius: 12px;
  background: #4c291a; color: #fff4df; font: 600 18px/1.3 system-ui; cursor: pointer; }
.web-action:disabled { opacity: .6; cursor: wait; }
.web-error { color: #9b201c; min-height: 1em; }

body.web-client.playing { background-position: center; background-size: cover;
  height: min(100dvh, 940px); margin-block: max(0px, calc((100dvh - 940px) / 2)); }
body.web-client.playing #table-felt {
  inset: calc(max(0px, (100dvh - 940px) / 2) + 40px) max(4vw, calc((100vw - 1320px) / 2)) calc(max(0px, (100dvh - 940px) / 2) + 90px);
  background: #17434b; border: 12px solid #85512e; border-radius: 150px;
  box-shadow: inset 0 0 0 3px #bb895b, inset 0 10px 35px #072c3680, 0 15px 45px #3b1c1866; }
body.web-client.playing #turnline { left: 50%; right: auto; width: max-content; max-width: 80%;
  transform: translateX(-50%); background: #17434b; border-radius: 10px; padding-inline: 12px; text-shadow: none; }
body.web-client.playing #actions { position: fixed; }
body.web-client.playing #btn-radio { right: max(20px, calc((100vw - 1320px) / 2)); }
body.web-client.playing #btn-chat { left: max(20px, calc((100vw - 1320px) / 2)); }
