body,
html {
  margin: 0;
  background-color: #000;
  color: #444;
  width: 100%;
  height: 100%;
  border: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

::selection {
  color: white;
}

div {
  color: antiquewhite;
  touch-action: none;
}

h1,
p {
  margin: 0 0 1em;
}

.flex-container {
  display: flex;
  align-items: stretch;
  background-color: #2e9097;
}

.flex-container > div {
  background-color: #1c802d;
  border: 1px;
  color: grey;
}

#snookerScore {
  font-family: var(--font-family-primary);
  font-size: 32px;
  color: yellow;
  text-align: center;
  filter: drop-shadow(0.08em 0.08em black);
  display: flex;
  flex-flow: row wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

#snookerScoreOverlay {
  position: absolute;
  bottom: 10px;
  right: 80px;
}

.p1Score,
.p2Score,
.hudMiddle {
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.p1Score.is-active,
.p2Score.is-active {
  font-weight: 800;
  filter: brightness(1.2);
}

.breakScore {
  font-size: 32px;
  font-style: italic;
  color: yellow;
  text-align: center;
  margin-top: 0.2em;
}

.view3d {
  width: 100%;
  flex: 1;
  min-height: 0;
  cursor: none;
  caret-color: transparent;
  -webkit-user-drag: none;
  user-select: none;
  position: relative;
}

.view3d:focus {
  outline: none;
}

canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border-radius: 5px;
  -webkit-user-drag: none;
  user-select: none;
}

.panel {
  width: 100%;
  height: 70px;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 0;
  padding: 0;
  background: linear-gradient(rgb(0 64 94), #000214);
  border-radius: 0;
  border-top: 1px solid #2d1e16;
  box-sizing: border-box;
  position: relative;
}

.aimControlColumn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  position: relative;
}

.toggleButton {
  height: 100%;
  width: 20%;
  margin-right: 4px;
  aspect-ratio: 0.4;
  border-radius: 10px;
  border-width: 4px;
  padding: 0;
  max-width: 80px;
}

.toggleButton:active,
.menuButton:active {
  transform: scale(0.97);
}

a.pill {
  outline: none;
  background: rgb(0 0 0 / 40%);
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid rgb(255 255 255 / 15%);
  margin: 0;
  padding: 0 8px;
  font-size: 12px;
  height: 30px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

a {
  color: lightblue;
}

.constants {
  background: linear-gradient(#495155, #0b0b0e);
  border-radius: 5px;
  position: fixed;
  right: 0;
  top: 0;
  visibility: hidden;
  padding: 5px;
  border: double;
  max-width: 50%;
  font-size: 12px;
}

.nw {
  display: inline-block;
}

label {
  display: inline-block;
  width: 9ch;
}

/* Bot Debug Overlay */
#botDebugOverlay {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 320px;
  min-height: 30px;
  max-height: 400px;
  background: rgb(0 0 0 / 40%);
  border: 1px solid rgb(255 255 255 / 15%);
  border-radius: 8px;
  padding: 0 8px;
  font-family: var(--font-family-mono);
  font-size: 16px;
  color: #ccc;
  z-index: 2000;
  overflow: hidden;
  display: none;
  box-sizing: border-box;
  align-items: center;
  flex-direction: column;
}

#botDebugOverlay header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
  min-height: 30px;
}

#botDebugOverlay header span#botDebugToggle {
  cursor: pointer;
}

#botDebugOverlay header button {
  background: transparent;
  border: 1px solid #666;
  color: #aaa;
  cursor: pointer;
  padding: 2px 6px;
  font-size: 12px;
  border-radius: 4px;
  height: 22px;
}

#botDebugOverlay header button:hover {
  background: #333;
  color: #fff;
}

#botDebugOverlay header div {
  display: flex;
  align-items: center;
  gap: 8px;
}

#botDebugLog {
  margin: 4px 0 0;
  padding: 0;
  max-height: 340px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

#botDebugLog::-webkit-scrollbar {
  width: 8px;
}

#botDebugLog::-webkit-scrollbar-track {
  background: #222;
}

#botDebugLog::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 4px;
}

/* Compact mode */
#botDebugOverlay.compact {
  width: 50px;
  height: 30px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

#botDebugOverlay.compact #botDebugLog {
  max-height: 0;
  overflow: hidden;
}

#botDebugOverlay.compact #botDebugClear {
  display: none;
}

/* Lobster emoji in header */
#botDebugOverlay header > span {
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  position: relative;
  top: -2px;
}

#helpOverlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(90%, 380px);
  height: min(90%, 620px);
  background: rgb(0 0 0 / 100%);
  border: 1px solid rgb(255 255 255 / 25%);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  z-index: 3000;
  box-shadow: 0 8px 16px rgb(0 0 0 / 75%);
}

#helpOverlay[hidden] {
  display: none !important;
}

#helpOverlay iframe {
  width: 100%;
  flex: 1;
  border: none;
  border-radius: 8px;
}

.cue-selector,
.table-selector {
  position: absolute;
  top: 50%;
  right: 22px;
  width: min(420px, calc(100% - 44px));
  max-height: min(680px, calc(100% - 44px));
  transform: translateY(-50%);
  overflow: auto;
  box-sizing: border-box;
  padding: 18px;
  color: #f5f1e8;
  background:
    radial-gradient(circle at 82% 0%, rgb(43 108 95 / 34%), transparent 34%),
    linear-gradient(155deg, rgb(16 18 19 / 98%), rgb(27 25 22 / 98%));
  border: 1px solid rgb(232 209 158 / 24%);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgb(0 0 0 / 58%);
  z-index: 3100;
  pointer-events: auto;
}

.cue-selector[hidden],
.table-selector[hidden] {
  display: none !important;
}

.cue-selector__header,
.table-selector__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.cue-selector__eyebrow,
.table-selector__eyebrow {
  color: #c3a96d;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.cue-selector h2,
.table-selector h2 {
  margin: 5px 0 0;
  font-size: 25px;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.cue-selector__intro,
.table-selector__intro {
  margin: 9px 0 16px;
  color: #aaa8a1;
  font-size: 13px;
}

.cue-selector__close,
.table-selector__close {
  width: 34px;
  height: 34px;
  color: #ddd7ca;
  background: rgb(255 255 255 / 7%);
  border: 1px solid rgb(255 255 255 / 11%);
  border-radius: 50%;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.cue-style-options,
.table-style-options {
  display: grid;
  gap: 9px;
}

.cue-style-option,
.table-style-option {
  display: grid;
  grid-template-columns: 76px 1fr 22px;
  gap: 13px;
  align-items: center;
  width: 100%;
  padding: 11px;
  color: inherit;
  text-align: left;
  background: rgb(255 255 255 / 4%);
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 12px;
  cursor: pointer;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

.cue-style-option:hover,
.table-style-option:hover {
  transform: translateY(-1px);
  background: rgb(255 255 255 / 7%);
  border-color: rgb(220 190 125 / 28%);
}

.cue-style-option.is-selected,
.table-style-option.is-selected {
  background: rgb(49 112 96 / 18%);
  border-color: rgb(205 179 116 / 58%);
}

.cue-style-preview,
.table-style-preview {
  display: flex;
  height: 16px;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 999px;
  box-shadow: 0 2px 7px rgb(0 0 0 / 38%);
}

.cue-style-swatch,
.table-style-swatch {
  flex: 1;
}

.cue-style-copy,
.table-style-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.cue-style-copy strong,
.table-style-copy strong {
  font-size: 14px;
  font-weight: 650;
}

.cue-style-copy small,
.table-style-copy small {
  overflow: hidden;
  color: #aaa8a1;
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cue-style-check,
.table-style-check {
  color: #ddbf76;
  opacity: 0;
  font-size: 17px;
}

.cue-style-option.is-selected .cue-style-check,
.table-style-option.is-selected .table-style-check {
  opacity: 1;
}

.table-style-heading {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
}

.table-style-heading em {
  flex: 0 0 auto;
  padding: 2px 6px;
  color: #c8b27d;
  background: rgb(203 177 117 / 10%);
  border: 1px solid rgb(203 177 117 / 20%);
  border-radius: 999px;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
}

.table-selector.is-loading .table-style-options {
  opacity: 0.55;
  pointer-events: none;
}

@media (width <= 640px) {
  .cue-selector,
  .table-selector {
    inset: auto 10px 10px;
    width: auto;
    max-height: min(72%, 580px);
    transform: none;
    padding: 15px;
    border-radius: 16px;
  }
}

.help-footer {
  display: flex;
  gap: 4px;
  padding: 8px 16px;
  border-top: 1px solid rgb(255 255 255 / 10%);
  justify-content: center;
  align-items: center;
}

.help-text {
  color: #ccc;
  font-size: 0.75rem;
}

.lobby-btn,
#helpClose {
  padding: 6px;
  background: rgb(255 255 255 / 10%);
  color: white;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.lobby-btn:hover,
#helpClose:hover {
  background: rgb(255 255 255 / 20%);
  border-color: rgb(255 255 255 / 40%);
}

#botDebugLog::-webkit-scrollbar-thumb:hover {
  background: #777;
}

.drill-panel {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  pointer-events: auto;
}

.drill-panel-top {
  top: 10px;
  transform: none;
}

.drill-panel-right {
  inset: auto 10px 49px auto;

  /* .outerMenu (hamburger/camera buttons) overflows 39px above #panel's top
     edge, i.e. above #viewP1's bottom edge; clear that plus a small gap. */
  transform: none;
}

/* When the elevation panel is open the Hit button shifts up; the drill buttons
   are lifted above it. DrillPanel sets `bottom` inline at runtime by measuring
   the Hit button's actual top; here we just switch to bottom-anchoring. */
.drill-panel.elevation-open {
  top: auto;
  transform: none;
}

.drill-gap {
  height: 44px;
}

/* The 44px spacer aligns Preview with the Hit button when centered; it is not
   needed once the stack is lifted above the elevation panel. */
.drill-panel.elevation-open .drill-gap {
  height: 0;
}

.drill-btn {
  width: 90px;
  height: 44px;
  border-radius: 8px;
  border: 2px solid rgb(255 255 255 / 25%);
  background: rgb(0 30 60 / 75%);
  color: antiquewhite;
  font-size: 13px;
  font-family: var(--font-family-primary, sans-serif);
  cursor: pointer;
  user-select: none;
  transition:
    opacity 0.15s,
    background 0.15s;
}

.drill-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.drill-btn:not(:disabled):hover {
  background: rgb(0 60 110 / 85%);
  border-color: rgb(255 255 255 / 50%);
}

.drill-btn:not(:disabled):active {
  transform: scale(0.96);
}

/* ===========================================================================
   Shot analysis split-screen mode (?ruletype=threecushion&practice&analysis)
   Left: live 3D table (#viewP1). Right: results panel (#analysisPanel). The
   table pane is responsively sized so CameraTop orients it (upright in a
   narrow pane, horizontal in a wide one) automatically.
   =========================================================================== */

/* Grid: table top-left, the game's control panel bottom-left, analysis panel
   down the right. Using grid (not flex) keeps #panel's own internal layout
   (cue-ball spin widget, hit button, power slider) intact — we just hand it the
   bottom-left cell and hide the menu buttons. */
body.analysis-mode {
  display: grid;
  grid-template: "table panel" 1fr "controls panel" auto / 72% 28%;
}

body.analysis-mode #viewP1 {
  grid-area: table;
  width: auto;
  height: 100%;

  /* Let the table cell shrink: the WebGL canvas carries an explicit pixel size,
     which would otherwise become the cell's min-content size and overflow. */
  min-width: 0;
  min-height: 0;
}

/* Keep the control panel, but show only the aim controls the analysis view
   wants (cue-ball spin + elevation, hit button, speed slider). Hide the game
   menu/share/concede/comment buttons; the camera toggle is the floating button. */
body.analysis-mode #panel {
  grid-area: controls;
  background: transparent;
  border-top: 0;
}

body.analysis-mode .outerMenu,
body.analysis-mode #commentMenu {
  display: none;
}

#analysisPanel {
  grid-area: panel;
  min-width: 0;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  background: #15151a;
  border-left: 1px solid #2a2a30;
  color: #eee;
  font-family: system-ui, sans-serif;
  overflow-y: auto;
}

.analysis-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #2a2a30;
}

.analysis-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.analysis-content {
  padding: 14px;
}

/* Floating camera-toggle, lower-right of the table pane (only active control). */
.analysis-camera-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 1px solid rgb(255 255 255 / 25%);
  background: rgb(0 30 60 / 75%);
  color: antiquewhite;
  font-size: 22px;
  cursor: pointer;
  z-index: 5;
}

.analysis-camera-btn:hover {
  background: rgb(0 60 110 / 85%);
}

/* Stack table / controls / analysis vertically on portrait/narrow screens. */
@media (orientation: portrait) {
  body.analysis-mode {
    grid-template: "table" 1fr "controls" auto "panel" 45% / 100%;
  }

  #analysisPanel {
    border-left: 0;
    border-top: 1px solid #2a2a30;
  }
}

/* --- analysis results (ported from the former standalone page) --- */
#analysisPanel h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #9aa0a6;
  margin: 16px 0 8px;
}

.analysis-status {
  color: #9aa0a6;
  font-size: 13px;
  margin-bottom: 8px;
}

.analysis-results .legend {
  display: flex;
  gap: 14px;
  font-size: 13px;
  color: #9aa0a6;
  margin: 8px 0;
}

.analysis-results .legend span::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}

.analysis-results .legend .ok::before {
  background: #2ec27e;
}

.analysis-results .legend .fail::before {
  background: #e0556b;
}

.analysis-results .legend .original::before {
  background: transparent;
  border: 2px solid #fff;
}

.plot-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.analysis-content canvas {
  background: #0d0d10;
  border-radius: 6px;
  display: block;
  max-width: 100%;
  height: auto;
  image-rendering: auto;
}

/* The renderer sets an explicit pixel size on its canvas; cap it to the cell. */
body.analysis-mode #viewP1 > canvas {
  max-width: 100%;
}

.bars {
  margin-top: 14px;
}

.bar-row {
  margin: 16px 0;
}

.bar-label {
  font-size: 14px;
  color: #9aa0a6;
  margin-bottom: 2px;
}

/* Header row of a 1-D bar: the on-demand "Show" button left of the label. */
.bar-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.bar-head .bar-label {
  margin-bottom: 0;
}

.bar-show {
  flex: none;
  padding: 2px 10px;
  font-size: 12px;
  color: #fff;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  background: #2f7d6e;
}

.bar-show:disabled {
  opacity: 0.5;
  cursor: default;
}

.bar-show:hover:not(:disabled) {
  background: #3a988e;
}

/* The bar whose 1-D sweep is currently shown (blue = the live/active accent). */
.bar-row.active .bar-show {
  background: #4aa3ff;
}

.bar-row.active .bar-label {
  color: #cfd3d8;
}

.bar-shiftrow {
  position: relative;
  height: 16px;
  font-size: 13px;
  color: #9aa0a6;
  margin-bottom: 2px;
}

.bar-shift-label {
  position: absolute;
  top: 0;
  white-space: nowrap;
}

.bar-shift-label--left {
  padding-right: calc(6px + 3ch);
}

.bar-shift-label--right {
  padding-left: calc(6px + 3ch);
}

/* Row containing the track+ruler column flanked by the two step buttons.
   flex-start (not center) — .bar-trackcol holds the track AND the taller
   ruler below it, so centering against the whole column would push the
   buttons below the track; flex-start aligns them with the track itself,
   the column's first/top child. */
.bar-trackrow {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.bar-trackcol {
  flex: 1;
  min-width: 0;
}

.bar-track {
  position: relative;
  display: flex;
  height: 16px;
  border-radius: 3px;
  overflow: hidden;
  background: #0d0d10;
}

.bar-cell {
  flex: 1;
}

/* A small colored patch under the marker, showing the live point's result
   (red/green, matching the scatter dot colors) even when the bar hasn't been
   Shown — also doubles as a visual cue for the size of one grid step.
   Positioned/sized by positionMarkers; colored via .scored/.missed by
   updateBarLiveCellFill, always on, independent of which bar is "active". */
.bar-live-cell {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  background: transparent;
  pointer-events: none;
}

.bar-live-cell.scored {
  background: #2ec27e;
}

.bar-live-cell.missed {
  background: #e0556b;
}

/* The bowtie marker = the current shot's value on that bar (two triangles
   meeting at the marker's position). Always plain white — coloring it
   directly used to camouflage it against an identically-colored cell once
   the bar was Shown (the live-cell patch above now carries the color
   instead). Positioned by AnalysisPanel via left %. */
.bar-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 12px;
  margin-left: -6px;
  pointer-events: none;
  z-index: 2;
}

.bar-marker::before,
.bar-marker::after {
  content: "";
  position: absolute;
  top: 0;
  width: 0;
  height: 0;
  border-style: solid;
}

.bar-marker::before {
  left: 0;
  border-width: 8px 6px 8px 0;
  border-color: transparent #fff transparent transparent;
}

.bar-marker::after {
  right: 0;
  border-width: 8px 0 8px 6px;
  border-color: transparent transparent transparent #fff;
}

/* Step buttons: move the marker exactly one grid step left/right. Solid CSS
   triangles (same construction as the marker) so the two read as one visual
   language; muted grey by default, white on hover, dimmed once the studied
   window's edge is reached (no further step possible). */
.bar-step {
  flex: none;
  width: 14px;
  height: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.bar-step::before {
  content: "";
  position: absolute;
  top: 0;
  width: 0;
  height: 0;
  border-style: solid;
}

.bar-step--left::before {
  right: 1px;
  border-width: 6px 7px 6px 0;
  border-color: transparent #cdd1d6 transparent transparent;
}

.bar-step--right::before {
  left: 1px;
  border-width: 6px 0 6px 7px;
  border-color: transparent transparent transparent #cdd1d6;
}

.bar-step:disabled {
  cursor: default;
}

.bar-step--left:disabled::before {
  border-right-color: #3a3a40;
}

.bar-step--right:disabled::before {
  border-left-color: #3a3a40;
}

.bar-step--left:hover:not(:disabled)::before {
  border-right-color: #fff;
}

.bar-step--right:hover:not(:disabled)::before {
  border-left-color: #fff;
}

/* The single white ring = the current shot's spin on the scatter. Positioned by
   AnalysisPanel via left/top %. */
.spin-marker {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 3;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 50%);
}

/* Filled with the live point's simulated result (green/red, matching the
   scatter dot colors) once known; hollow/white while pending or while a 1-D
   bar is the active display. */
.spin-marker.scored {
  background: #2ec27e;
}

.spin-marker.missed {
  background: #e0556b;
}

.bar-ruler {
  position: relative;
  height: 22px;
  margin-top: 2px;
}

.bar-tick {
  position: absolute;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%);
}

.bar-tick--start {
  align-items: flex-start;
  transform: none;
}

.bar-tick--end {
  align-items: flex-end;
  transform: translateX(-100%);
}

.bar-tick-mark {
  width: 1px;
  height: 4px;
  background: #51515a;
}

.bar-tick-label {
  font-size: 12px;
  color: #9aa0a6;
  margin-top: 2px;
  white-space: nowrap;
}

.analysis-results .error {
  color: #e0556b;
  font-size: 15px;
}

.spin-show {
  position: absolute;
  left: 10px;
  bottom: 14px;
  width: auto;
  padding: 8px 14px;
  font-size: 14px;
  color: #fff;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  background: #2f7d6e;
  box-shadow: 0 1px 4px rgb(0 0 0 / 40%);
}

.spin-show:hover:not(:disabled) {
  background: #3a988e;
}

/* The spin scatter is currently the live display (blue = the live/active
 * accent, matching .bar-row.active .bar-show). Needs an explicit :hover
 * override too — otherwise .spin-show:hover (2 selectors) outranks
 * .spin-show.active (also 2) on hover and the green flashes back. */
.spin-show.active,
.spin-show.active:hover {
  background: #4aa3ff;
}

.analysis-toolbar {
  display: none;
}

.analysis-toolbar button.secondary {
  background: #34343c;
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
}

/* stylelint-disable-next-line no-descending-specificity -- scoped disabled state */
#analysisPanel button:disabled {
  opacity: 0.5;
  cursor: default;
}

/* stylelint-disable no-descending-specificity, no-duplicate-selectors -- deliberate late overrides for the game HUD */

/* 2026 game HUD refinement */
#snookerScoreOverlay {
  inset: 70px auto auto 50%;
  transform: translateX(-50%);
  z-index: 1502;
}

#snookerScoreOverlay:not(:has(.breakScore:not(:empty))) {
  display: none;
}

#snookerScore {
  min-width: 82px;
  min-height: 32px;
  padding: 5px 12px;
  box-sizing: border-box;
  gap: 16px;
  color: #f4ead4;
  background: linear-gradient(180deg, rgb(19 22 23 / 92%), rgb(8 10 11 / 86%));
  border: 1px solid rgb(226 192 112 / 38%);
  border-radius: 999px;
  box-shadow:
    0 12px 32px rgb(0 0 0 / 34%),
    inset 0 1px rgb(255 255 255 / 7%);
  backdrop-filter: blur(12px);
  filter: none;
}

#snookerScore:empty {
  display: none;
}

.hud-name {
  max-width: 15ch;
  overflow: hidden;
  color: #a9aca8;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud-value {
  color: #f5eee0;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.p1Score.is-active .hud-name,
.p2Score.is-active .hud-name,
.p1Score.is-active .hud-value,
.p2Score.is-active .hud-value {
  color: #efcd78;
}

.breakScore {
  margin: 0;
  color: #efcd78;
  font-size: 15px;
  font-style: normal;
}

.panel {
  flex: 0 0 78px;
  min-height: 78px;
  height: 78px;
  padding: 7px 10px 8px;
  gap: 10px;
  align-items: flex-end;
  overflow: visible;
  z-index: 1800;
  background:
    linear-gradient(90deg, rgb(30 24 17 / 82%), transparent 28%),
    linear-gradient(180deg, #171a1b, #090b0c);
  border-top: 1px solid rgb(220 184 101 / 38%);
  box-shadow:
    0 -14px 34px rgb(0 0 0 / 32%),
    inset 0 1px rgb(255 255 255 / 4%);
}

.view3d {
  z-index: 0;
  overflow: hidden;
  cursor: grab;
}

.view3d.is-camera-orbiting {
  cursor: grabbing;
}

.view3d > canvas {
  cursor: inherit;
}

.camera-control-hint {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 20;
  padding: 7px 10px;
  color: rgb(236 240 249 / 72%);
  background: rgb(3 8 20 / 58%);
  border: 1px solid rgb(142 174 226 / 18%);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 24%);
  font-size: 11px;
  letter-spacing: 0.03em;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.reposition-cue-ball {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 25;
  min-height: 40px;
  padding: 0 16px;
  color: #f7e7b7;
  background: linear-gradient(180deg, rgb(35 52 70 / 94%), rgb(11 21 35 / 94%));
  border: 1px solid rgb(229 194 112 / 48%);
  border-radius: 999px;
  box-shadow:
    0 12px 30px rgb(0 0 0 / 32%),
    inset 0 1px rgb(255 255 255 / 10%);
  cursor: pointer;
  transform: translateX(-50%);
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.reposition-cue-ball:hover {
  border-color: rgb(239 205 126 / 78%);
  background: linear-gradient(180deg, rgb(46 68 91 / 98%), rgb(15 29 47 / 98%));
}

.aimControlColumn {
  align-self: flex-end;
  height: 70px;
  z-index: 2100;
}

.outerMenu {
  align-self: flex-end;
  z-index: 2200;
}

.powerSliderContainer {
  height: 48px;
  margin: 0 auto;
  background: #17130d;
  border: 1px solid rgb(222 187 107 / 34%);
  border-radius: 10px;
  box-shadow:
    inset 0 0 0 1px rgb(0 0 0 / 42%),
    0 5px 18px rgb(0 0 0 / 24%);
}

.power-track {
  opacity: 0.82;
  background: linear-gradient(90deg, #7b261e 0%, #c88126 58%, #efd773 100%);
}

.cue-selector,
.table-selector {
  scrollbar-color: #8b7441 transparent;
}

.cue-customizer {
  padding: 14px;
  background:
    radial-gradient(circle at 100% 0%, rgb(224 190 108 / 12%), transparent 42%),
    rgb(255 255 255 / 4%);
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: 14px;
  transition:
    background 150ms ease,
    border-color 150ms ease;
}

.cue-customizer.is-selected {
  background:
    radial-gradient(circle at 100% 0%, rgb(224 190 108 / 18%), transparent 42%),
    rgb(49 112 96 / 15%);
  border-color: rgb(205 179 116 / 58%);
}

.cue-customizer__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.cue-customizer__heading > div {
  display: grid;
  gap: 2px;
}

.cue-customizer__heading span {
  color: #aaa8a1;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.cue-customizer__heading strong {
  color: #f4eddf;
  font-size: 15px;
}

.cue-customizer__badge {
  padding: 3px 7px;
  color: #d9bd79 !important;
  background: rgb(211 178 98 / 10%);
  border: 1px solid rgb(211 178 98 / 24%);
  border-radius: 999px;
  font-weight: 700;
}

.cue-customizer__colours {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 13px;
}

.cue-customizer__colours label {
  display: grid;
  width: auto;
  gap: 5px;
  color: #aaa8a1;
  font-size: 10px;
  text-align: center;
}

.cue-customizer__colours input[type="color"] {
  width: 100%;
  height: 34px;
  padding: 2px;
  background: rgb(255 255 255 / 5%);
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 8px;
  cursor: pointer;
}

.cue-customizer__patterns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.cue-customizer__patterns label {
  display: grid;
  gap: 5px;
  color: #aaa8a1;
  font-size: 10px;
}

.cue-customizer__patterns select {
  min-width: 0;
  height: 36px;
  padding: 0 8px;
  color: #ece6dc;
  background: #18262a;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 8px;
}

.cue-customizer__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 13px;
}

.cue-customizer__actions button {
  min-height: 38px;
  color: #e8e1d5;
  background: rgb(255 255 255 / 6%);
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 9px;
  cursor: pointer;
  font-weight: 650;
}

.cue-customizer__actions button:last-child {
  color: #17140e;
  background: #dec176;
  border-color: #efd996;
}

.cue-customizer__actions button:active {
  transform: translateY(1px);
}

@media (width <= 640px) {
  #snookerScoreOverlay {
    top: 66px;
  }

  #snookerScore {
    min-width: 160px;
    min-height: 38px;
    padding: 5px 12px;
  }

  .panel {
    flex-basis: 72px;
    min-height: 72px;
    height: 72px;
    padding-inline: 6px;
    gap: 6px;
  }

  .powerSliderContainer {
    height: 42px;
  }
}
/* stylelint-enable no-descending-specificity, no-duplicate-selectors */
