.bs-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 14px 22px;
  color: var(--cg-ink);
  font-family: Inter, Arial, sans-serif;
}

.bs-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.bs-stats,
.bs-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.bs-stat {
  min-width: 68px;
  padding: 7px 10px;
  border: 1px solid var(--cg-line);
  border-radius: 10px;
  background: var(--cg-panel);
  box-shadow: 0 8px 20px rgba(33, 43, 40, 0.08);
  text-align: center;
}

.bs-stat span {
  display: block;
  color: var(--cg-muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.05em;
  line-height: 1.1;
  text-transform: uppercase;
}

.bs-stat strong {
  display: block;
  margin-top: 2px;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.bs-btn,
.bs-close {
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--cg-line);
  border-radius: 10px;
  background: var(--cg-panel);
  color: var(--cg-ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(33, 43, 40, 0.08);
  transition: transform 120ms ease, border-color 120ms ease;
}

.bs-btn:hover,
.bs-close:hover {
  transform: translateY(-1px);
  border-color: var(--cg-teal);
}

.bs-btn:focus-visible,
.bs-close:focus-visible,
.bs-canvas:focus-visible {
  outline: 3px solid rgba(23, 162, 179, 0.45);
  outline-offset: 3px;
}

.bs-icon {
  display: inline-grid;
  padding: 0;
  place-items: center;
  font-size: 19px;
}

.bs-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bs-primary {
  border-color: transparent;
  background: var(--cg-teal);
  color: #fff;
}

.bs-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid #10333f;
  border-radius: 14px;
  background: #0d2531;
  box-shadow: var(--cg-shadow);
  touch-action: none;
  user-select: none;
}

.bs-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 10 / 13;
  max-height: min(74vh, 680px);
  cursor: crosshair;
}

.bs-hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(9, 26, 34, 0.72);
  color: #d6eef6;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
  backdrop-filter: blur(6px);
}

.bs-coarse {
  display: none;
}

@media (pointer: coarse) {
  .bs-fine {
    display: none;
  }

  .bs-coarse {
    display: inline;
  }
}

.bs-result {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  gap: 8px;
  width: min(86%, 320px);
  padding: 20px;
  border: 1px solid var(--cg-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  text-align: center;
  box-shadow: 0 26px 70px rgba(9, 26, 34, 0.45);
  transform: translate(-50%, -50%);
  backdrop-filter: blur(10px);
}

.bs-result span,
.bs-result p {
  margin: 0;
  color: var(--cg-muted);
  font-size: 13.5px;
  line-height: 1.35;
}

.bs-result strong {
  font-size: 27px;
  line-height: 1;
}

.bs-result-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.bs-result-row .bs-btn {
  flex: 1 1 0;
}

.bs-legend {
  margin: 10px 0 0;
  color: var(--cg-muted);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

.bs-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(13, 37, 49, 0.42);
}

.bs-modal-card {
  position: relative;
  width: min(100%, 440px);
  padding: 22px;
  border: 1px solid var(--cg-line);
  border-radius: 14px;
  background: var(--cg-panel);
  box-shadow: 0 26px 76px rgba(30, 37, 40, 0.28);
}

.bs-modal-card h2 {
  margin: 0 48px 10px 0;
  font-size: 23px;
  line-height: 1.1;
}

.bs-modal-card p {
  margin: 9px 0 0;
  color: var(--cg-muted);
  font-size: 14px;
  line-height: 1.5;
}

.bs-close {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.bs-hidden {
  display: none !important;
}

@media (max-width: 620px) {
  .bs-shell {
    padding: 0 8px 16px;
  }

  .bs-top {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .bs-stats {
    justify-content: space-between;
    gap: 6px;
  }

  .bs-stat {
    min-width: 0;
    flex: 1 1 0;
    padding: 6px 4px;
  }

  .bs-stat strong {
    font-size: 17px;
  }

  .bs-actions {
    justify-content: center;
  }

  .bs-canvas {
    aspect-ratio: 10 / 14;
    max-height: 74vh;
  }

  .bs-hint {
    font-size: 11.5px;
  }
}
