.billiards-page {
  background: #101913;
}
.billiards-play {
  margin-top: 8px;
}
.pool-scoreboard {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 60px;
  max-width: 1050px;
  margin: 0 auto;
  padding: 20px 5px 12px;
  min-height: 88px;
}
.pool-player {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 215px;
  max-width: 300px;
}
.pool-player.is-turn::after {
  content: "";
  position: absolute;
  bottom: -12px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #c7b77c88, transparent);
}
.pool-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #9a9d6133;
  border: 1px solid #c0bb8138;
  color: #d3cba4;
  display: grid;
  place-items: center;
  font: 19px var(--serif);
}
.pool-avatar.p2 {
  background: #385c453e;
}
.pool-player > div:not(.pool-avatar) {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.player-label {
  font-size: 12px;
  color: #d3d9c5;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pool-group {
  font-size: 10px;
  color: #a0ad95;
  white-space: nowrap;
}
.pool-player strong {
  font: 31px var(--serif);
  font-variant-numeric: tabular-nums;
  color: #dbcea8;
  margin-left: auto;
}
.pool-player#pool-player-1 strong {
  margin-left: 0;
  margin-right: auto;
}
.pool-player#pool-player-1 > div:nth-child(2) {
  text-align: right;
}
.pool-match-info {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 205px;
}
.pool-match-info .eyebrow {
  font-size: 8px;
  letter-spacing: 2px;
  color: #93a186;
}
#pool-turn-label {
  font-size: 12px;
  letter-spacing: 0.1px;
  color: #c0c8b2;
  line-height: 1.5;
}
#pool-canvas-wrap {
  position: relative;
  height: clamp(360px, calc(100dvh - 400px), 630px);
  max-width: 1240px;
  margin: 0 auto;
  isolation: isolate;
  overflow: hidden;
}
#pool-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}
#pool-canvas:focus-visible {
  outline-offset: -5px;
  border-radius: 8px;
}
.pool-note {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: #c0c8b2;
  line-height: 1.6;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
  white-space: nowrap;
}
.pool-note.active {
  opacity: 1;
}
.pool-call {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: #dfc99a;
  background: #162519ed;
  border-radius: 30px;
  padding: 10px 19px;
  white-space: nowrap;
}
.pocketed-tray {
  max-width: 1030px;
  padding: 5px 5px 11px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 32px;
}
.pocketed-row {
  display: flex;
  gap: 7px;
  min-width: 180px;
}
.pocketed-row:last-child {
  justify-content: flex-end;
}
.pool-wordmark {
  font-size: 8px;
  letter-spacing: 2px;
  color: #829479;
  white-space: nowrap;
}
.pocketed-ball {
  height: 20px;
  width: 20px;
  display: grid;
  place-items: center;
  color: #ece9dc;
  opacity: 0.34;
  border: 1px solid #c2c7a83b;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 600;
  background: var(--ball-color);
  box-shadow: inset -2px -2px 3px #00180950;
}
.pocketed-ball.sunk {
  opacity: 1;
}
.pocketed-ball.striped {
  background: linear-gradient(#ddd9c7 21%, var(--ball-color) 22% 78%, #ddd9c7 79%);
}
.pool-controls {
  max-width: 1200px;
  margin: 4px auto 0;
  padding: 16px 8px 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.pool-options {
  min-width: 290px;
}
.mode-switch.small {
  border: 0;
  background: #1a281c;
  padding: 3px;
}
.mode-switch.small button {
  font-size: 11px;
  min-height: 36px;
  padding: 7px 13px;
}
.pool-aux {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 2px;
}
.pool-aux .text-button {
  font-size: 11px;
  min-height: 36px;
  color: #a6b698;
  white-space: nowrap;
}
.pool-aux .text-button[aria-pressed="false"] {
  opacity: 0.5;
}
.spin-control {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 151px;
}
.spin-control > div {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.spin-control .eyebrow {
  font-size: 8px;
  letter-spacing: 1.5px;
}
#spin-label {
  font-size: 11px;
  color: #b4c0a4;
  max-width: 86px;
  line-height: 1.5;
}
#spin-ball {
  width: 53px;
  height: 53px;
  flex-shrink: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 25%, #fffcf0, #e8e3ca 45%, #b4b298 75%, #6a7660 99%);
  border: 1px solid #e6dfbe;
  box-shadow: 0 3px 8px #0007;
  position: relative;
  touch-action: none;
}
.spin-cross::before,
.spin-cross::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 15%;
  width: 1px;
  height: 70%;
  background: #6a765c33;
}
.spin-cross::after {
  transform: rotate(90deg);
}
#spin-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border: 1px solid #e6dac3;
  border-radius: 50%;
  background: #a14b3e;
  transform: translate(-4px, -4px);
  z-index: 1;
  box-shadow: 0 1px 2px #0005;
}
.power-control {
  flex: 1;
  min-width: 145px;
  max-width: 350px;
}
.power-heading {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #bac7ac;
}
.power-heading output {
  color: #d2c091;
  font-variant-numeric: tabular-nums;
}
.power-control input[type="range"] {
  appearance: none;
  width: 100%;
  height: 36px;
  border: 0;
  background: transparent;
  margin: 6px 0;
  display: block;
  cursor: pointer;
}
.power-control input::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 3px;
  background: linear-gradient(90deg, #bec08b var(--range-progress, 28%), #344731 var(--range-progress, 28%));
}
.power-control input::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border-radius: 50%;
  background: #d9cca5;
  border: 3px solid #293423;
  box-shadow: 0 0 0 1px #aea878;
}
.power-control input::-moz-range-track {
  height: 4px;
  background: #344731;
}
.power-control input::-moz-range-progress {
  height: 4px;
  background: #bec08b;
}
.power-control input::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #d9cca5;
  border: 2px solid #293423;
}
.control-tip {
  font-size: 10px;
  color: #8e9e83;
}
.shoot-button {
  min-width: 132px;
  min-height: 52px;
  border-radius: 7px;
  padding: 14px 23px;
  font-size: 15px;
}
.pool-winner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 30px 38px;
  border: 1px solid #d6c79166;
  box-shadow: 0 15px 80px #0009;
  border-radius: 15px;
  text-align: center;
  background: #1a3029f5;
  min-width: 260px;
  max-width: 90%;
  backdrop-filter: blur(9px);
}
.pool-winner h2 {
  font-size: 26px;
  line-height: 1.5;
  margin: 6px 0 22px;
  font-weight: 400;
  letter-spacing: -1px;
  overflow-wrap: anywhere;
}
.pool-winner .button-primary {
  min-width: 170px;
}
@media (max-width: 1100px) {
  .pool-scoreboard {
    gap: 24px;
  }
  .pool-match-info {
    min-width: 160px;
  }
  .pool-player {
    min-width: 175px;
  }
  .pool-controls {
    gap: 20px;
  }
  .pool-options {
    min-width: 265px;
  }
  .mode-switch.small button {
    padding: 7px 10px;
  }
  .spin-control {
    min-width: 133px;
    gap: 10px;
  }
  .shoot-button {
    min-width: 95px;
    padding: 12px 18px;
    font-size: 14px;
  }
  .pocketed-row {
    min-width: 170px;
  }
  .pocketed-tray {
    padding: 0 20px 12px;
  }
  .pocketed-ball {
    width: 19px;
    height: 19px;
  }
  .pocketed-row {
    gap: 5px;
  }
}
@media (max-width: 850px) {
  .pool-controls {
    flex-wrap: wrap;
    gap: 14px 24px;
    padding: 12px 0 20px;
  }
  .pool-options {
    width: calc(65% - 24px);
    min-width: 0;
  }
  .spin-control {
    width: 35%;
    justify-content: flex-end;
  }
  .power-control {
    max-width: none;
  }
  .shoot-button {
    min-width: 150px;
  }
  .pool-scoreboard {
    gap: 18px;
  }
  .pool-player {
    min-width: 145px;
  }
  .pool-avatar {
    width: 29px;
    height: 29px;
  }
  .player-label {
    font-size: 11px;
  }
  .pool-match-info {
    min-width: 105px;
  }
  .pool-match-info .eyebrow {
    font-size: 6px;
    letter-spacing: 1px;
  }
  #pool-turn-label {
    font-size: 11px;
  }
  .pocketed-tray {
    padding: 0 0 10px;
    gap: 8px;
  }
  .pool-wordmark {
    display: none;
  }
  .pool-note {
    font-size: 10px;
    max-width: 94%;
    white-space: normal;
    text-align: center;
  }
  .pool-call {
    font-size: 11px;
    padding: 8px 13px;
  }
  #pool-canvas-wrap {
    height: 430px;
  }
}
@media (max-width: 619px) {
  .billiards-page .table-toolbar {
    padding: 10px 0 4px;
  }
  .billiards-page #btn-expand {
    display: none;
  }
  .billiards-page .table-tools {
    gap: 8px;
  }
  .billiards-page .mode-switch button {
    padding: 6px 10px;
    min-height: 40px;
    font-size: 11px;
  }
  .billiards-play {
    margin-top: 0;
  }
  .pool-scoreboard {
    gap: 12px;
    justify-content: space-between;
    min-height: 66px;
    padding: 9px 0 12px;
  }
  .pool-player {
    min-width: 95px;
    gap: 7px;
    max-width: 40%;
  }
  .pool-avatar {
    display: none;
  }
  .pool-player strong {
    font-size: 24px;
  }
  .player-label {
    max-width: 90px;
    font-size: 11px;
  }
  .pool-group {
    font-size: 9px;
  }
  .pool-player > div:not(.pool-avatar) {
    gap: 5px;
  }
  .pool-match-info {
    min-width: 64px;
    max-width: 130px;
    gap: 0;
  }
  .pool-match-info .eyebrow {
    display: none;
  }
  #pool-turn-label {
    font-size: 10px;
  }
  .pool-player.is-turn::after {
    bottom: -9px;
  }
  #pool-canvas-wrap {
    height: clamp(295px, calc(100svh - 372px), 590px);
    margin: 0 -6px;
  }
  .pool-note {
    bottom: 0;
    font-size: 10px;
  }
  .pool-call {
    top: 8px;
    font-size: 10px;
    max-width: 94%;
    white-space: normal;
  }
  .pocketed-tray {
    padding: 3px 0;
    min-height: 25px;
  }
  .pocketed-row {
    min-width: 128px;
    gap: 4px;
  }
  .pocketed-ball {
    width: 16px;
    height: 16px;
    font-size: 8px;
  }
  .pool-controls {
    gap: 8px 16px;
    padding: 9px 0 calc(12px + env(safe-area-inset-bottom));
    margin-top: 0;
  }
  .pool-options {
    width: calc(70% - 16px);
    min-width: 0;
  }
  .spin-control {
    width: 30%;
    min-width: 0;
    gap: 8px;
  }
  .spin-control .eyebrow {
    display: none;
  }
  .spin-control > div {
    max-width: 48px;
  }
  #spin-ball {
    width: 45px;
    height: 45px;
  }
  #spin-label {
    font-size: 9px;
  }
  .mode-switch.small {
    width: 100%;
    justify-content: space-between;
  }
  .mode-switch.small button {
    min-height: 40px;
    padding: 7px 6px !important;
    font-size: 10px !important;
  }
  .pool-aux {
    gap: 17px;
    margin-top: 0;
  }
  .pool-aux .text-button {
    font-size: 10px;
    min-height: 36px;
  }
  .power-heading {
    font-size: 11px;
  }
  .power-control input[type="range"] {
    margin: 2px 0;
    height: 36px;
  }
  .control-tip {
    display: none;
  }
  .shoot-button {
    min-height: 47px;
    min-width: 108px;
    font-size: 14px;
  }
  .pool-winner {
    padding: 24px;
    min-width: 235px;
  }
  .pool-winner h2 {
    font-size: 22px;
  }
  .online-status-row strong {
    flex-basis: auto;
  }
  .online-status-row .text-button {
    font-size: 10px;
  }
  .online-panel:has(#online-options[hidden]) {
    margin: 4px 0;
    padding: 3px 8px;
  }
  .online-panel:has(#online-options[hidden]) .online-status-row {
    flex-wrap: nowrap;
  }
  .online-panel:has(#online-options[hidden]) #online-status {
    max-width: 90px;
    font-size: 10px;
  }
  .online-panel:has(#online-options[hidden]) ~ .billiards-play #pool-canvas-wrap {
    height: clamp(260px, calc(100svh - 422px), 540px);
  }
}
@media (max-width: 360px) {
  .spin-control > div {
    display: none;
  }
  .pool-player {
    min-width: 82px;
  }
  .player-label {
    max-width: 65px;
  }
  .pool-controls .mode-switch.small button {
    font-size: 9px !important;
  }
  .pool-options {
    width: calc(76% - 16px);
  }
  .spin-control {
    width: 24%;
  }
}
