/* Drill table editor / player */
.cs-drill {
  --cs-felt: #0f766e;
  --cs-ink: #0b1f17;
  margin: 16px 0 20px;
}
.cs-drill-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.cs-drill-toolbar .btn.is-active,
.cs-drill-controls .btn.is-active {
  background: var(--cs-felt);
  color: #fff;
  border-color: var(--cs-felt);
}
.cs-drill-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cs-drill-palette {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  background: #f4f7f6;
  border-radius: 12px;
  border: 1px solid rgba(15, 35, 28, 0.08);
}
.cs-drill-palette__ball {
  border: 2px solid transparent;
  background: #fff;
  border-radius: 10px;
  padding: 4px;
  cursor: pointer;
  flex: 0 0 auto;
}
.cs-drill-palette__ball.is-active {
  border-color: var(--cs-felt);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.2);
}
.cs-drill-palette__ball img,
.cs-drill-palette__swatch {
  width: 36px;
  height: 36px;
  display: block;
  border-radius: 50%;
  box-sizing: border-box;
}
.cs-drill-palette__swatch {
  border: 2px solid rgba(15, 35, 28, 0.25);
}
.cs-drill-palette__swatch--stripe {
  background-image: linear-gradient(180deg, transparent 30%, #f8fafc 30%, #f8fafc 70%, transparent 70%) !important;
}
.cs-drill-stage {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #2a1810;
  box-shadow: 0 12px 32px rgba(11, 31, 23, 0.18);
}
.cs-drill-stage canvas {
  display: block;
  width: 100%;
  touch-action: none;
  cursor: crosshair;
}
.cs-drill-meta {
  display: grid;
  gap: 10px;
}
.cs-drill-meta label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5b6b63;
  display: block;
  margin-bottom: 4px;
}
.cs-drill-player {
  margin-top: 8px;
}
.cs-drill-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  padding: 12px;
  background: #f8faf9;
  border-radius: 12px;
  border: 1px solid rgba(15, 35, 28, 0.08);
}
.cs-drill-controls label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 600;
  color: var(--cs-ink);
}
.cs-drill-controls input[type="range"] {
  width: 140px;
}
.cs-drill-objective {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 118, 110, 0.1);
  color: #0a4f4a;
  font-weight: 600;
}
.cs-badge--success-targets {
  display: inline-block;
  max-width: 100%;
  white-space: normal;
  line-height: 1.4;
  padding: 8px 12px;
  background: rgba(250, 204, 21, 0.18);
  color: #854d0e;
  border: 1px solid rgba(250, 204, 21, 0.45);
  font-weight: 600;
}
.cs-drill-status {
  margin-left: auto;
  font-size: 13px;
  color: #5b6b63;
}
.cs-drill-player.is-ball-in-hand .cs-drill-stage canvas {
  cursor: grab;
}
.cs-drill-player.is-ball-in-hand.is-placing-cue .cs-drill-stage canvas {
  cursor: grabbing;
}
.cs-drill-player.is-ball-in-hand .cs-drill-status {
  color: #0f766e;
  font-weight: 600;
}
.cs-badge--drill {
  background: rgba(15, 118, 110, 0.14);
  color: #0f766e;
}
.cs-drill-type-panel[hidden],
.cs-drill-preview[hidden] {
  display: none !important;
}

@media (max-width: 720px) {
  .cs-drill-palette {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 10px;
  }
}
