/* Бильярд: экран партии. Окно, шапка, чат, итоги — общие классы «Дурака» (.dk-*) из style.css; здесь табло,
   стол на canvas в деревянной рамке с золотым кантом и панель удара. */

.bl-play { gap: 8px; }

/* табло сторон */
.bl-score { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 10px; padding: 4px 4px 0; }
.bl-vs { align-self: center; font: 800 22px var(--font-d); color: var(--brass2); }
.bl-side {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 8px 14px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(23, 37, 31, .72);
  transition: border-color .2s, box-shadow .2s;
}
.bl-side:last-of-type { flex-direction: row-reverse; padding: 8px 8px 8px 14px; }
.bl-side:last-of-type .bl-names { align-items: flex-end; }
.bl-side:last-of-type .bl-pts { text-align: left; justify-items: start; }
.bl-side.turn { border-color: rgba(240, 204, 133, .6); box-shadow: 0 0 0 1px rgba(240, 204, 133, .35), 0 0 24px -8px rgba(240, 204, 133, .6); }
.bl-side.won { border-color: var(--gold); background: linear-gradient(160deg, rgba(200, 161, 90, .2), rgba(23, 37, 31, .8)); }
.bl-names { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bl-p { display: inline-flex; align-items: center; gap: 8px; min-width: 0; opacity: .75; }
.bl-p.shooter { opacity: 1; }
.bl-p .chip { width: 30px; height: 30px; font-size: 12px; border: 0; padding: 0; cursor: pointer; }
.bl-p.shooter .chip { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--gold2); }
.bl-p b { max-width: 140px; overflow: hidden; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.bl-mark { display: inline-flex; color: var(--warn); font-style: normal; }
.bl-mark .ic { width: 14px; height: 14px; }
.bl-pts { display: grid; justify-items: end; text-align: right; gap: 2px; }
.bl-pts b { font: 800 26px/1 var(--font-d); color: var(--paper); font-variant-numeric: tabular-nums; }
.bl-pts span { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* стол */
.bl-wrap { position: relative; flex: 1; min-height: 160px; display: grid; place-items: center; padding: 6px; }
.bl-canvas {
  display: block;
  border-radius: 16px;
  box-shadow: 0 0 0 2px rgba(200, 161, 90, .45), 0 30px 60px -24px rgba(0, 0, 0, .9);
  touch-action: none;
  cursor: crosshair;
}
.bl-tip {
  position: absolute;
  top: 16px;
  left: 50%;
  translate: -50% 0;
  z-index: 3;
  max-width: calc(100% - 40px);
  padding: 7px 16px;
  border-radius: 99px;
  background: rgba(8, 18, 14, .85);
  box-shadow: inset 0 0 0 1px rgba(200, 161, 90, .35);
  color: var(--paper);
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, translate .25s;
}
.bl-tip.in { opacity: 1; translate: -50% 4px; }
.bl-tip.bad { background: rgba(140, 34, 24, .92); box-shadow: none; }
.bl-final { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 14px 0 18px; font: 800 34px var(--font-d); color: var(--paper); }
.bl-final span { color: var(--brass2); }

/* панель удара */
.bl-controls { flex: none; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 0 8px calc(8px + env(safe-area-inset-bottom)); }
.bl-spinbox { display: grid; justify-items: center; gap: 2px; }
.bl-spinbox canvas { cursor: pointer; touch-action: none; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(200, 161, 90, .5), 0 8px 16px -8px rgba(0, 0, 0, .8); }
.bl-spinbox span { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.bl-powerbox { display: grid; gap: 8px; min-width: 0; }
.bl-powerbox canvas { cursor: pointer; touch-action: none; display: block; }
.bl-say { text-align: center; }
.bl-shoot { min-width: 120px; }

@media (max-width: 760px) {
  .bl-score { gap: 6px; }
  .bl-side { padding: 5px 8px 5px 5px; gap: 6px; }
  .bl-side:last-of-type { padding: 5px 5px 5px 8px; }
  .bl-p .chip { width: 24px; height: 24px; font-size: 10px; }
  .bl-p b { max-width: 70px; font-size: 12px; }
  .bl-pts b { font-size: 20px; }
  .bl-pts span { font-size: 9px; }
  .bl-controls { gap: 8px; }
  .bl-shoot { min-width: 84px; height: 44px; }
  .bl-canvas { border-radius: 10px; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .bl-score { display: none; }
}

/* главная бильярда: стол Дани с пирамидой */
.bl-show { position: absolute; inset: 0; display: grid; place-items: center; padding: 8vh 3vw 8vh 2vw; }
.bl-show-canvas { display: block; border-radius: 18px; transform: perspective(1600px) rotateX(24deg); box-shadow: 0 0 0 2px rgba(200, 161, 90, .4), 0 60px 90px -30px rgba(0, 0, 0, .95); animation: settle 1.4s cubic-bezier(.2, .8, .2, 1) both; }

/* стол стоит вертикально на телефоне в руке: холст повёрнут (billiards.js, Painter.resize) */
.bl-canvas.rot { position: absolute; left: 50%; top: 50%; translate: -50% -50%; rotate: 90deg; }
@media (max-width: 480px) {
  .bl-p b { display: none; }
  .bl-pts span { max-width: 90px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .bl-controls { grid-template-columns: auto minmax(0, 1fr) auto; }
}
