.puzzle-captcha-widget {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 480px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  background: #fff;
}

.puzzle-captcha-widget.dark {
  background: #1a1a2e;
  color: #eee;
}

.puzzle-captcha-loading {
  padding: 40px 20px;
  text-align: center;
  color: #888;
  font-size: 14px;
}

.puzzle-captcha-image-wrapper {
  position: relative;
  margin: 0 auto;
  overflow: hidden;
  background: #f0f0f0;
}

.puzzle-captcha-bg {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity 0.3s;
}

.puzzle-captcha-piece {
  position: absolute;
  top: 0;
  left: 0;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
  z-index: 2;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
  transition: opacity 0.3s;
  touch-action: none;
  pointer-events: none;
}

.puzzle-captcha-piece:hover {
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.5));
}

.puzzle-captcha-slider-wrapper {
  padding: 12px 16px;
}

.puzzle-captcha-slider-track {
  position: relative;
  height: 40px;
  background: #e8e8e8;
  border-radius: 20px;
  cursor: pointer;
  overflow: hidden;
}

.puzzle-captcha-widget.dark .puzzle-captcha-slider-track {
  background: #2a2a3e;
}

.puzzle-captcha-slider-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, #4285f4, #34a853);
  border-radius: 20px;
  width: 0%;
  transition: width 0.05s linear;
}

.puzzle-captcha-slider-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 36px;
  height: 36px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  z-index: 3;
  touch-action: none;
  user-select: none;
  transition: box-shadow 0.2s;
}

.puzzle-captcha-slider-thumb.active {
  cursor: grabbing;
  box-shadow: 0 2px 12px rgba(66, 133, 244, 0.5);
}

.puzzle-captcha-slider-icon {
  font-size: 14px;
  color: #4285f4;
  line-height: 1;
}

.puzzle-captcha-actions {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
  align-items: center;
}

.puzzle-captcha-refresh-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #ddd;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.puzzle-captcha-widget.dark .puzzle-captcha-refresh-btn {
  background: #2a2a3e;
  border-color: #444;
  color: #eee;
}

.puzzle-captcha-refresh-btn:hover {
  background: #f0f0f0;
}

.puzzle-captcha-submit-btn {
  flex: 1;
  height: 36px;
  border: none;
  border-radius: 18px;
  background: #4285f4;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.puzzle-captcha-submit-btn:hover {
  background: #3367d6;
}

.puzzle-captcha-submit-btn:disabled {
  background: #a0c4ff;
  cursor: not-allowed;
}

.puzzle-captcha-widget.dark .puzzle-captcha-submit-btn {
  background: #5b8def;
}

.puzzle-captcha-result {
  padding: 0 16px 12px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.puzzle-captcha-result.success {
  color: #34a853;
}

.puzzle-captcha-result.fail {
  color: #ea4335;
}
