@import url("/fonts.css");
:root {
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #233c36;
  background: #f6f7f3;
  font-synthesis: none;
  --green: #174e3d;
  --muted: #7a867e;
  --line: #e2e6df;
  --lime: #d5ed9c;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  display: flex;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  border: 0;
  transition:
    background 0.15s,
    transform 0.15s;
}
button:hover:not(:disabled) {
  filter: brightness(0.96);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #95be6b;
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
[hidden] {
  display: none !important;
}
.rail {
  width: 244px;
  position: fixed;
  inset: 0 auto 0 0;
  background: #102d27;
  color: #edf3e9;
  padding: 36px 23px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.5px;
}
.ball {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e7f0dc;
  color: #123c2f;
  font-size: 25px;
  box-shadow: inset 0 0 0 7px #123c2f;
  border: 1px solid #628070;
}
.brand-light {
  font-weight: 350;
  display: block;
  font-size: 16px;
  letter-spacing: 1.5px;
}
.rail-label {
  font-size: 9px;
  letter-spacing: 1.7px;
  color: #94afa0;
  margin: 24px 0 45px;
}
nav {
  display: grid;
  gap: 9px;
}
.nav {
  background: transparent;
  color: #b2c7bb;
  text-align: left;
  border-radius: 7px;
  padding: 15px 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav span {
  font-size: 20px;
  width: 22px;
}
.nav.active {
  background: #29453a;
  color: #e4f4cb;
}
.nav small {
  margin-left: auto;
  background: #395548;
  padding: 2px 6px;
  border-radius: 4px;
}
.rail-bottom {
  margin-top: auto;
  font-size: 12px;
  color: #c3d2c7;
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #cce68c;
  border-radius: 50%;
  margin-right: 7px;
}
.rail-bottom p {
  font-size: 11px;
  line-height: 1.7;
  color: #90a89a;
  margin: 9px 0 24px;
}
.version {
  font-size: 10px;
  letter-spacing: 1.6px;
  color: #839d8f;
}
main {
  margin-left: 244px;
  width: calc(100% - 244px);
  padding: 0 42px;
}
header {
  height: 90px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 1.4px;
  color: #819084;
}
.owner-label {
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0;
  font-size: 12px;
}
.avatar {
  height: 29px;
  width: 29px;
  border-radius: 50%;
  background: #e5e9db;
  display: grid;
  place-items: center;
  color: #4c644d;
}
.page-heading {
  margin: 35px 0 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: #7e906f;
  margin-bottom: 10px;
  font-weight: 700;
}
h1 {
  font-weight: 550;
  font-size: 34px;
  letter-spacing: -1.1px;
  margin: 0 0 11px;
  line-height: 1.15;
}
p {
  font-size: 13px;
  line-height: 1.7;
  margin: 0;
  color: #7a857d;
}
h2 {
  font-weight: 500;
  font-size: 22px;
}
h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 16px;
}
.pill {
  font-size: 11px;
  color: #5b7157;
  background: #ecf0e2;
  border: 1px solid #dfe6d4;
  padding: 9px 14px;
  border-radius: 20px;
  white-space: nowrap;
}
.capture-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 285px;
  gap: 25px;
}
.camera-box {
  aspect-ratio: 16/9;
  background: #142f28;
  border-radius: 11px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px #12321b09;
}
.camera-box video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.camera-box canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.camera-box canvas.calibrating {
  pointer-events: auto;
  cursor: crosshair;
}
#camera-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: radial-gradient(ellipse at center, #234b39, #102e27);
  color: #edf5e5;
}
#camera-empty p {
  text-align: center;
  color: #9cb5a6;
  font-size: 12px;
  margin-bottom: 22px;
}
.camera-glyph {
  font-size: 42px;
  color: #b8d399;
  border: 1px solid #54745b;
  border-radius: 16px;
  height: 70px;
  width: 70px;
  display: grid;
  place-items: center;
  margin-bottom: 5px;
}
#camera-empty h2 {
  margin: 16px 0 10px;
}
.video-top,
.video-bottom {
  position: absolute;
  left: 18px;
  right: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}
.video-top {
  top: 17px;
  font-size: 8px;
  letter-spacing: 1.4px;
  color: #c9d8c9;
}
.video-top span {
  background: #122a23c9;
  padding: 7px 9px;
  border-radius: 4px;
}
#record-badge {
  background: #b33f32;
  color: white;
}
.video-bottom {
  bottom: 16px;
  color: #a9c1af;
  font-size: 10px;
}
#elapsed {
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  color: #ebf3e7;
}
.primary,
.secondary,
.danger {
  border-radius: 6px;
  font-size: 12px;
  font-weight: 550;
  min-height: 41px;
  padding: 11px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
}
.primary {
  background: var(--green);
  color: white;
}
#camera-empty .primary {
  background: #d7eba9;
  color: #244333;
}
.secondary {
  background: #fff;
  border: 1px solid #dce3d9;
  color: #3c5146;
}
.danger {
  background: #b84c3e;
  color: white;
}
.full {
  width: 100%;
}
.transport {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}
.transport strong {
  display: block;
  font-size: 12px;
}
.transport small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 7px;
}
.transport-buttons {
  display: flex;
  gap: 8px;
}
.below-camera {
  display: flex;
  gap: 23px;
  flex-wrap: wrap;
  font-size: 10px;
  color: #8a958a;
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding: 16px 0;
}
.below-camera b {
  font-weight: 500;
  color: #5d715e;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 22px;
}
.settings-column {
  display: grid;
  align-content: start;
  gap: 17px;
}
.card-title {
  display: flex;
  justify-content: space-between;
  align-items: start;
}
.card-title span {
  font-size: 10px;
  color: #a4afa0;
}
.card label,
.login-card label,
dialog label {
  display: block;
  font-size: 11px;
  color: #647466;
  margin: 16px 0 12px;
}
input:not([type="range"]),
select,
textarea {
  display: block;
  width: 100%;
  border: 1px solid #e0e5dd;
  background: #fafbf8;
  border-radius: 5px;
  padding: 10px 11px;
  font-size: 12px;
  color: #344f3d;
  margin-top: 7px;
  min-height: 39px;
}
input[type="range"] {
  width: 100%;
  accent-color: #335d42;
  display: block;
  margin-top: 13px;
}
#sensitivity-value {
  float: right;
  font-size: 10px;
}
.muted {
  color: #859080;
  font-size: 12px;
  line-height: 1.7;
}
.hint {
  font-size: 10px;
  color: #8c9787;
  line-height: 1.7;
  margin-top: 10px;
}
.text-button {
  background: transparent;
  color: #7e8c7c;
  font-size: 11px;
  margin-top: 10px;
  padding: 8px;
}
.tip {
  display: flex;
  gap: 13px;
  padding: 7px 6px;
}
.tip > span {
  font-size: 20px;
  color: #708b61;
}
.tip b {
  font-size: 11px;
  font-weight: 600;
}
.tip p {
  font-size: 11px;
  line-height: 1.7;
  margin-top: 6px;
}
.live-shots {
  margin-top: 25px;
  padding: 22px;
  border: 1px dashed #d9e0d2;
  border-radius: 8px;
}
.live-shots h3 {
  font-size: 12px;
}
.live-shots h3 span {
  background: #e7eddd;
  border-radius: 4px;
  padding: 2px 7px;
  margin-left: 8px;
  font-size: 10px;
}
.live-chip {
  display: inline-block;
  margin: 4px;
  padding: 8px;
  background: #eaf0e3;
  border-radius: 5px;
  font-size: 11px;
}
.capture-warning {
  font-size: 11px;
  margin: 22px 0;
}
.notice {
  background: #fff4db;
  color: #785a28;
  padding: 14px 18px;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.6;
  margin-top: 18px;
}
.notice.error {
  background: #fff0eb;
  color: #9a3c2e;
}
.session-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  min-height: 250px;
}
.session-card {
  cursor: pointer;
  text-align: left;
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0;
  overflow: hidden;
  align-self: start;
}
.session-art {
  height: 130px;
  background: #234b39;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d6e7b7;
  font-size: 37px;
}
.session-body {
  padding: 19px;
}
.session-body h3 {
  margin-bottom: 10px;
}
.session-body p {
  font-size: 11px;
}
.session-body small {
  display: block;
  margin-top: 14px;
  color: #5c7256;
  font-size: 11px;
}
.empty-card {
  grid-column: 1/-1;
  padding: 70px;
  text-align: center;
  border: 1px dashed #cdd8c4;
  border-radius: 10px;
}
.device-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.device-grid .card p {
  margin: 12px 0 20px;
}
.device {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.device b {
  font-size: 13px;
}
.device small {
  display: block;
  margin-top: 7px;
}
.pair-number {
  font-size: 28px;
  letter-spacing: 4px;
  margin: 14px 0;
  font-variant-numeric: tabular-nums;
}
#pair-result {
  margin-top: 20px;
}
#pair-qr {
  width: 170px;
  max-width: 100%;
}
#pair-url {
  font-size: 11px;
  word-break: break-all;
  color: var(--green);
}
.review-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 24px;
}
#playback {
  width: 100%;
  aspect-ratio: 16/9;
  background: #102d27;
  border-radius: 9px;
}
.playback-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-top: 15px;
}
.playback-tools label {
  font-size: 11px;
}
.playback-tools select {
  width: 80px;
  margin: 0;
}
.shot {
  padding: 15px 0;
  border-top: 1px solid var(--line);
}
.shot-main {
  width: 100%;
  background: transparent;
  display: flex;
  text-align: left;
  gap: 12px;
  padding: 0;
}
.shot-number {
  height: 34px;
  width: 34px;
  display: grid;
  place-items: center;
  background: #e9efdf;
  border-radius: 5px;
  font-size: 12px;
}
.shot-text {
  font-size: 12px;
}
.shot-text small {
  display: block;
  font-size: 10px;
  color: #899482;
  margin-top: 5px;
}
.shot-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.shot-actions button,
.shot-actions a {
  font-size: 10px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fafbf8;
  text-decoration: none;
  color: #526448;
}
.shot p {
  font-size: 11px;
  margin-top: 10px;
}
.shot-panel {
  max-height: 650px;
  overflow: auto;
}
.login-card {
  max-width: 450px;
}
.login-card hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  width: 400px;
  max-width: 95vw;
  padding: 25px;
  color: #233c36;
}
dialog::backdrop {
  background: #102d2780;
}
.dialog-buttons {
  display: flex;
  justify-content: end;
  gap: 10px;
  margin-top: 20px;
}
footer {
  border-top: 1px solid var(--line);
  margin: 40px 0 0;
  padding: 22px 0;
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 1.7px;
  color: #9aa491;
}
footer span {
  letter-spacing: 0;
  font-size: 10px;
}
.camera-mode .rail,
.camera-mode .owner-label {
  display: none;
}
.camera-mode main {
  margin-left: 0;
  width: 100%;
  max-width: 1100px;
  margin: auto;
}
.camera-mode header {
  height: 55px;
}
.camera-mode .capture-grid {
  grid-template-columns: minmax(0, 1fr) 275px;
}
@media (min-width: 1500px) {
  main {
    padding-left: 60px;
    padding-right: 60px;
  }
  .capture-grid {
    grid-template-columns: minmax(0, 1fr) 310px;
  }
}
@media (max-width: 1150px) {
  .rail {
    width: 205px;
    padding: 30px 16px;
  }
  main {
    margin-left: 205px;
    width: calc(100% - 205px);
    padding: 0 25px;
  }
  .capture-grid {
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 18px;
  }
  .transport {
    align-items: start;
    flex-direction: column;
  }
  h1 {
    font-size: 29px;
  }
  .card {
    padding: 17px;
  }
  .review-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 850px) {
  .rail {
    position: relative;
    width: 100%;
    padding: 15px 20px;
    display: block;
  }
  .brand {
    font-size: 16px;
  }
  .brand-light {
    display: inline;
    font-size: 16px;
    margin-left: 4px;
  }
  .ball {
    width: 32px;
    height: 32px;
    font-size: 19px;
  }
  .rail-label,
  .rail-bottom {
    display: none;
  }
  body {
    display: block;
  }
  nav {
    display: flex;
    margin-top: 15px;
    gap: 4px;
  }
  .nav {
    padding: 10px;
    font-size: 11px;
    flex: 1;
  }
  .nav span {
    font-size: 16px;
    width: auto;
  }
  .nav small {
    display: none;
  }
  main {
    margin-left: 0;
    width: 100%;
    padding: 0 20px;
  }
  header {
    height: 58px;
    font-size: 8px;
  }
  .capture-grid,
  .camera-mode .capture-grid {
    grid-template-columns: 1fr;
  }
  .settings-column {
    grid-template-columns: 1fr 1fr;
  }
  .tip {
    grid-column: 1/-1;
  }
  .page-heading {
    margin: 25px 0;
  }
  .device-grid {
    grid-template-columns: 1fr;
  }
  .transport {
    flex-direction: row;
    align-items: center;
  }
  .owner-label {
    font-size: 10px;
  }
  footer span {
    display: none;
  }
}
@media (max-width: 520px) {
  h1 {
    font-size: 26px;
  }
  .page-heading p {
    font-size: 12px;
  }
  .pill {
    padding: 7px 9px;
    font-size: 9px;
  }
  .settings-column {
    grid-template-columns: 1fr;
  }
  .camera-box {
    aspect-ratio: 4/3;
  }
  .camera-glyph {
    height: 48px;
    width: 48px;
    font-size: 30px;
  }
  #camera-empty h2 {
    font-size: 18px;
  }
  .transport {
    flex-direction: column;
    align-items: stretch;
  }
  .transport-buttons {
    justify-content: space-between;
  }
  .below-camera {
    gap: 13px;
  }
  .page-heading {
    align-items: start;
  }
  .nav {
    padding: 10px 5px;
    gap: 6px;
    font-size: 10px;
  }
  .review-grid {
    gap: 15px;
  }
}
.video-bottom #camera-info {
  max-width: 80%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tracking-panel {
  margin-top: 20px;
}
.ball-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0;
  font-size: 14px;
}
.table-map {
  position: relative;
  aspect-ratio: 2;
  background: #205e4b;
  border: 9px solid #14372e;
  border-radius: 16px;
  margin: 14px 0;
  overflow: hidden;
  max-width: 700px;
}
.table-ball {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 25px;
  height: 25px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  font: 600 11px sans-serif;
  color: white;
  background: #bd7940;
  box-shadow: 0 1px 4px #0008;
}
.table-ball.stripe {
  background: linear-gradient(#fff 20%, #bd7940 20%, #bd7940 80%, #fff 80%);
  color: #171717;
}
.table-ball.cue {
  background: #faf8ef;
  color: #161d19;
}
.table-ball.eight {
  background: #171717;
}
.table-ball.unknown {
  background: #7a8580;
}
#track-balls {
  width: auto;
}

.aim-card {
  margin-top: 20px;
}
#aim-map {
  width: 100%;
  height: auto;
  background: #174b3d;
  border: 10px solid #674d36;
  border-radius: 18px;
  touch-action: manipulation;
}
.nav[href] {
  text-decoration: none;
}

/* Shared PoolAgent visual system. */
body {
  background:
    radial-gradient(ellipse at 95% 0%, #e4ecd9 0, transparent 36%), #f6f7f3;
}
.rail {
  background:
    radial-gradient(circle at 0 100%, #244d3e, transparent 50%), #102d27;
}
.brand-light {
  font-size: 8px;
  letter-spacing: 2.3px;
  margin-top: 5px;
}
.card {
  box-shadow: 0 8px 32px #183c2d06;
}
.primary {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px #174e3d16;
}
.primary:hover {
  transform: translateY(-1px);
}
.nav {
  text-decoration: none;
}
.page-heading h1 {
  letter-spacing: -1.7px;
}
.notice {
  scroll-margin-top: 20px;
}
@media (prefers-reduced-motion: no-preference) {
  main > section {
    animation: arrive 0.32s ease-out;
  }
  @keyframes arrive {
    from {
      opacity: 0.5;
      transform: translateY(6px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
